Using CoreMedia Tag with a Headless Server

Last updated a month ago

Learn how to add CoreMedia Tag to a Headless Server.

Prerequisites

  • CoreMedia system with the Headless Server.

  • Basic knowledge of CoreMedia Studio and Engagement Studio.

  • A user with access to Engagement Studio.

  • An Engagement Cloud ID that is active.

Overview

To enable features with CoreMedia tag, you need to add a JavaScript tag to your website, which contains your CoreMedia Engagement Cloud ID and the URL to CoreMedia JavaScript. CoreMedia provides the JavaScript tag that contains the necessary code to load the CoreMedia JavaScript. You can choose to write your own JavaScript for CoreMedia tag.

Steps

1. Login to Engagement Studio.

engagement studio login

Use your user to login to Engagement Studio.

2. Copy the Tag code.

engagement studio profile menu
  1. On the top right corner of the Dashboard page, click on the name of the user.

  2. From the dropdown menu, select Scripts list.

engagement studio tag code

On the Settings page, select and copy your CoreMedia tag code.

3. Configure the Tag

<script>
  var bysideWebcare_webcare_id = "<your-coremedia-id>";
  var bysideWebcare_lang = "en";
</script>

<script src="https://bywe1.byside.com/agent/bwc_we1.js" type="text/javascript"></script>
  • To configure the CoreMedia tag, add more parameters to the parameter list above.

  • Include the parameter list and the link to the script in all the pages of the website where you want to use CoreMedia Tag.

CoreMedia recommends that you add the tag at the end of sections <head> or <body>.

4. Use Spark App to enable CoreMedia Tag

If the configuration via settings is not available, the app will look up environment variables as a fallback. Add the following environment variable to the .env file and add the values from the snippet that you have copied from the Settings page of your Engagement Studio.

On the server where the Spark App runs, edit file .env and add variable VITE_BYSIDE_WEBCARE_ID with your Engagement Cloud ID. For example,

VITE_BYSIDE_WEBCARE_ID="<your-coremedia-id>"

Optionally, add a variable VITE_BYSIDE_WEBCARE_SCRIPT_URL with the URL of the JavaScript that you want to use. For example,

VITE_BYSIDE_WEBCARE_SCRIPT_URL=https://bywe2.myserver.com/my_script.js

Result

After adding CoreMedia Tag to all the pages in your website, you can add new functionality to the website, monitor visitors activity, and react to visitors behavior.

Copyright © 2024 CoreMedia GmbH, CoreMedia Corporation. All Rights Reserved.
Loading...