Details
Integration Type | Dynamic Variable Prefix |
Analytics | csMatchingKey |
Contentsquare allows you to use your Adobe Analytics segments in every Contentsquare feature (Journey Analysis, Page Comparator, Zoning Analysis, Session Replay).
To import your segments, you need to add a snippet of code to your Adobe code configuration. This code pushes a unique identifier to Adobe Analytics. It helps us match Adobe Analytics sessions with Contentsquare one's.
Implementation
Create an eVar
Please configure a dedicated Contentsquare eVar with the following parameters set the way you see below:

There are many ways to integrate the code but we will cover the following options:
- Adobe Launch
- doPlugins function (Adobe Analytics legacy configurations)
- Tealium Tag Manager
Adobe Launch configuration
In Adobe Launch open your Adobe Analytics extension and press Configure

If you are using any of these additional options shown here, then please rather use the 2nd option above > doPlugins function (Adobe Site Catalyst - legacy configurations)

For this to work you need to be using the option Manage the library for me

Scroll down to CONFIGURE TRACKER USING CUSTOM CODE and press on the Open Editor button.

Grab the relevant code below in the code section and paste it into the open code editor box and save it then publish the changes

doPlugins function (Adobe Analytics legacy configurations)
Grab the relevant code below in the code section and then access your Adobe Analytics s code file and paste it in the doPlugins function.

First edit the line of the code below that has s.eVarX defined and either keep s as the object name or rename it to your equivalent but also set X to the value of the dedicated eVar.
s.eVarX = cmk;
Tealium Tag Manager configuration
In your Tealium account access the Data Layer section under the iQ Tag Management section

Click on Add Variable

Set the type to UDO Variable and make the source cs_matching_key or name it whatever you want but if you rename it then also edit and use the same name in the code too.

Save that and you should have this

Go to your Adobe Analytics tag container under the Tags section and edit your Mapped Variables

Search for the variable you created cs_matching_key or whatever you named it then select it and then press Select Destination.

Click on eVars then select the eVar you defined in Adobe Analytics and save that

You should then see something like this


Next go to Extensions and create a Javascript Code extension.
Give it a name relating to the Adobe and Contentsquare integration and set the scope to be the Adobe Analytics tag.
Grab the relevant code below in the code section and paste it in there.
Grab the relevant code below in the code section and paste it in there.

The Code
Adobe Launch & doPlugins function
In the code below you need to edit s.eVarX and change X to the eVar value you defined for this integration
s.eVarX = cmk;
/* *Name: Adobe Analytics CS Integration *Version: 1.9.0 (Adobe Launch + csMatchingKey) */ (function () { var version = "1.9.0"; function callback() { if (!disableCallback) { disableCallback = true; if (window.CS_CONF) { CS_CONF.integrations = CS_CONF.integrations || []; CS_CONF.integrations.push("Adobe Analytics - v" + version); } } } var disableCallback = false; window._uxa = window._uxa || []; _uxa.push(["afterPageView", callback]); var cmk = null; var cn = "_cs_mk_aa"; function init(cookieValue) { if (cookieValue) { cmk = cookieValue; } else { cmk = Math.random() + "_" + Date.now(); var tld = (function () { var i = 0, domain = document.domain, p = domain.split("."), s = "_cs_tld" + new Date().getTime(); while (i < p.length - 1 && document.cookie.indexOf(s + "=" + s) == -1) { domain = p.slice(-1 - ++i).join("."); document.cookie = s + "=" + s + ";domain=" + domain + ";SameSite=None;Secure"; } document.cookie = s + "=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=" + domain + ";"; return domain; })(); var now = new Date(); var time = now.getTime(); time += 30 * 60 * 1000; now.setTime(time); document.cookie = cn + "=" + cmk + "; expires=" + now.toUTCString() + ";path=/;domain=" + tld + ";SameSite=None;Secure"; } s.eVarX = cmk; _uxa.push([ "trackDynamicVariable", { key: "csMatchingKey", value: cmk, }, ]); } var cookies = "; " + document.cookie; if (cookies) { var getCookie = cookies.split("; " + cn + "="); if (getCookie.length == 1) { init(); } else { var cookieValue = getCookie[1].split(";")[0]; init(cookieValue); } } })(); //Adobe Analytics CS Integration End
Tealium Tag Manager
/* *Name: Adobe Analytics CS Integration *Version: 1.11.0 (Tealium + csMatchingKey) */ (function () { var version = "1.11.0"; function callback() { if (!disableCallback) { disableCallback = true; if (window.CS_CONF) { CS_CONF.integrations = CS_CONF.integrations || []; CS_CONF.integrations.push("Adobe Analytics - v" + version); } } } var disableCallback = false; window._uxa = window._uxa || []; _uxa.push(["afterPageView", callback]); var cmk = null; var cn = "_cs_mk_aa"; function init(cookieValue) { if (cookieValue) { cmk = cookieValue; } else { cmk = Math.random() + "_" + Date.now(); var now = new Date(); var time = now.getTime(); time += 30 * 60 * 1000; now.setTime(time); document.cookie = cn + "=" + cmk + "; expires=" + now.toUTCString() + ";path=/;domain=." + utag.cfg.domain + ";SameSite=None;Secure"; } b.cs_matching_key = cmk; _uxa.push([ "trackDynamicVariable", { key: "csMatchingKey", value: cmk, }, ]); } if (!b["cp._cs_mk_aa"]) { init(); } else { var getCookieValue = b["cp._cs_mk_aa"]; init(getCookieValue); } })(); //Adobe Analytics CS Integration End
Verifying it works
Navigate to your website, activate the Adobe Experience Cloud Debugger extension and open the Network tab in the extension popup. You shall see something similar to the image below. If not, the implementation failed.

You should see the same csMatchingKey value being sent to Contentsquare like this

Adobe Analytics Connector Configuration
After you have completed the steps above, you'll need to configure your Adobe Analytics Connector using this documentation.