Category: AB Testing
This integration is only available for Web projects
What to expect
This integration will allow you to segment and compare users based on Optimizely AB tests and variant groups they were exposed to.
What we collect
Dynamic Variables
Key | Value | Data Type |
AB_OP_Campaign Name or ID | {campaignID} | Text |
Implementation
For Optimizely Full Stack (server side) please resume below.
You will need to be using the Full Stack Notification Listeners in Optimizely for this to work. (We are aware this feature is being sunset by Optimizely and we will be providing support for their new Feature Experimentation feature.)
These listeners will retrieve the Optimizely experiment and variation data and send them to Contentsquare. It will make use of Optimizely's Full Stack client-side SDKs (Javascript, React, React Native). Server-side Optimizely Full Stack SDKs are not supported by this integration.
Just after calling Optimizely's createInstance() method, run this code:
/* *Name: Optimizely Full Stack Server Side Tests CS Integration Start *Version: 1.0.0 */ var optimizelyEnums = require("@optimizely/optimizely-sdk").enums; function onDecision(decisionObject) { function callback(context) { if (!disableCallback) { disableCallback = true; if (window.CS_CONF) { CS_CONF.integrations = CS_CONF.integrations || []; CS_CONF.integrations.push("Optimizely Full Stack - v1.0.0"); } } } var disableCallback = false; _uxa.push(["afterPageView", callback]); var csPrefix = "AB_OP_SS_", csKey, csValue; csKey = csPrefix + decisionObject.experiment.key; csValue = decisionObject.variation.key; window._uxa = window._uxa || []; window._uxa.push(["trackDynamicVariable", { key: csKey, value: csValue }]); } // Replace OptimizelyClient with the name of your Optimizely SDK Instance (where createInstance is used) optimizelyClient.notificationCenter.addNotificationListener(optimizelyEnums.NOTIFICATION_TYPES.ACTIVATE, onDecision); //Optimizely Full Stack Server Side Tests CS Integration End
On every experiment activation (method activate() or isFeatureEnabled is invoked), then an Optimizely's Notification Listener will execute, grabbing the experiment data from Optimizely and will forward them to Contentsquare.
For Optimizely Web (client side) please resume below.
Implementation Steps
Please go to the section How to request an integration to see the instructions to enable this integration. You can then return here once completed.
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