Category: AB Testing
This integration is only available for Web projects
What to expect
This integration will allow you to segment users and pages in Contentsquare based on Sitecore campaign variations.
What we collect
Dynamic Variables
Key | Value | Data Type |
AB_SI_{campaigName} | {variationName} | Text |
Implementation
Implementation Steps
Copy the following code to the context relating to your Sitecore implementation where the Sitecore API exists in order to retrieve and dynamically populate variables with the Sitecore values that will then need to be pushed back to the browser for rendering.
You will need to modify the code in the sections where you see comments in the code, basically replace the placeholders with the actual values dynamically to be sent back to the browser which will then automatically push those values to Contentsquare.
/* *Name: Sitecore CS Integration Start *Version: 1.0.0 */ (function () { var version = "1.0.0"; var tvp = "AB_SI_"; var disableCallback = false; window._uxa = window._uxa || []; function callback() { if (!disableCallback) { disableCallback = true; if (window.CS_CONF) { CS_CONF.integrations = CS_CONF.integrations || []; CS_CONF.integrations.push("Sitecore - v" + version); } } } _uxa.push(["afterPageView", callback]); function sendToCS(csKey, csValue) { csKey = tvp + csKey; _uxa.push([ "trackDynamicVariable", { key: csKey, value: csValue, }, ]); } //Replace the values below with the values of the Sitecore Experiment and Variation IDs var experimentID = [ADD_SITECORE_EXPERMIMENT_ID_HERE]; var variationID = [ADD_SITECORE_VARIATION_ID_HERE]; sendToCS(experimentID, variationID.toString()); })(); //Sitecore CS Integration End
If you have already completed the step above then continue below.
Verifying it works
You can use the chrome extension to check the results are sent to CS