Optimizely
Overview
Get the most out of Optimizely X by running experiments against any of your Lytics audiences.
Because Optimizely uses a synchronous tag that blocks page load and Lytics uses an asynchronous tag that will never affect page load, natively running experiments on the first page view for first time visitors is not recommended.
How it Works
- When someone visits a web property with the Lytics tag installed, Lytics will identify who they are and return a list of audiences they are currently a member of in real-time. This process happens very quickly but is asynchronous, meaning it is designed to never negatively impact performance.
- Once those profiles have been received, the audiences are stored in a cookie called
ly_segs
. This cookie is then updated, asynchronously, on every subsequent page view. - You will then set up a sync job between Optimizely X and Lytics from the Lytics interface. This ensures a set of audiences are automatically defined within Optimizely X which look for a membership map to the audiences stored in this cookie.
- Optimizely experiments are then configured to target your Lytics powered audiences.
Authorization
- Select
Account
->Security
->Authorizations
from the left side menu. - Click
+ Create New
at the top of the list. - Select
Optimizely
. - Select
Optimizely X Oauth
- Log in to Optimizely when prompted.
- Complete the authorization by adding a description.
This integration no longer supports "Optimizely Classic."
Create Audiences
Running this workflow will create an audience in Optimizely for each Lytics audience that has been API enabled.
Integration Details
- Implementation Type: Server-side Integration.
- Implementation Technique: REST API Integration .
- Frequency: Batch Integration every hour.
- Resulting data: Optimizely Audience.
This integration utilizes Optimizely APIs to create audiences. On each run of the job, it will:
- For each Lytics audience marked as API enabled an audience will be created in Optimizely with the name "Lytics" + audience name, and with the condition of a substring match of the key
ly_segs
and value of the corresponding audience slug. - The work will run continousouly. As new public audiences are created in Lytics, audiences will be created in Optimizely every hour.
Configuration
Follow these steps to set up and configure the export audience job for Optimizely in the Lytics platform. If you are new to creating jobs in Lytics, see the Jobs Dashboard documentation for more information.
- Click
Data Pipeline
->Jobs
from the left side menu. - Click
+ Create New
at the top of the list. - Select
Optimizely
. - Select
Create Audiences
. - Select the authorization created above.
- Add a
Label
andDescription
and then clickComplete
at the bottom right.
After a few minutes visit the Audiences
section of your Optimizely account to verify that the Lytics audiences are configured correctly.
Configure ly_segs Cookie Storage
As of version 3 of the Lytics JavaScript tag, audience membership is no longer actively stored as a cookie by default. This means that in order to facilitate the communication between Optimizely and Lytics you will need to install this additional code snippet on your website. Be sure to load this tag after the core Lytics JavaScript tag.
jstag.call('entityReady',function(p){var segments=[];if(p&&p.data&&p.data.user){segments=p.data.user.segments;}else if(p&&p.data&&p.data.segments){segments=p.data.segments;}if(segments.length>0){var t=JSON.stringify(segments);console.log(t);jstag.setCookie("ly_segs",t,604800);}else{console.warn("Unable to locate customer profile data or segment membership for personalization.");}});
Configuring Experiments
Once you have configured your audience following the steps above all that is left is to configure and test your experiment. Refer to the Optimizely documentation for associating an audience with an experiment.
Updated 5 days ago