Optimizely Sync

What is Optimizely?

Optimizely is an experimentation and feature delivery platform that helps teams test, personalize, and optimize digital experiences across web and mobile properties. It enables organizations to run A/B tests, multivariate experiments, and feature flag rollouts to understand user behavior and improve conversion outcomes.


Product Type: Experiments/Analytics

Integration Type: Starter Kit & ID Sync


Capabilities

  • Captures the optimizelyEndUserId set by the Optimizely web tag from first-party cookies.
  • Stores the Optimizely user identifier in first-party storage for reuse across sessions.
  • Adds the Optimizely user ID to server-side events for experimentation analysis and audience alignment.

Considerations

  • This is a hybrid integration that relies on the Optimizely web tag to generate the optimizelyEndUserId.
  • Please implement and maintain the Optimizely tag on all pages where experiments or feature flags are running.
  • If the Optimizely tag is not present on a page, the optimizelyEndUserId will not be set and the MetaRouter sync will not capture or refresh the identifier.
  • Once captured, the identifier is stored in first-party storage and used to enrich server-side events, even on subsequent pages where the Optimizely tag may not be loaded.

Sync Details

  • IDs:
    • optimizelyEndUserId – A unique identifier generated by the Optimizely web tag to consistently identify an end user across experiments and sessions.
  • Description:
    • The sync copies the optimizelyEndUserId value from the Optimizely first-party cookie.
    • The value is stored in first-party storage for the duration defined by the Cookie Lifetime setting.
    • The stored value is refreshed when a new Optimizely user ID is detected, or upon expiration of the configured lifetime, whichever occurs first.
    • The identifier is added to server-side event payloads for experimentation analysis and enrichment.
  • Server-side Event Payload: Server-side Event Payload: Upon completion of all vendor's sync, the server-side events will incorporate all resolved identifiers as described above. The following object will be appended to the context.providers property within the event's JSON payload.
{
   "optimizely": {
     "optimizelyEndUserId": "oeu1234567890123456r0.1234567890123456"
   }
}
  • Cookie Name:
    • Cookie: _meta_optimizely_optimizelyEndUserId
    • IndexedDB: _meta_optimizely_optimizelyEndUserId
    • For a general guide on ID Sync validation, see here.

Sync Setup Guide

Add an Optimizely Sync in MetaRouter

To gather the optimizelyEndUserId, you must add an Optimizely sync.

  1. From the Pipelines page, find the pipeline associated with the web property you’d like to add a sync to. Hover over the three dot dropdown and select “Build AJS File.”
  2. In the Identity Syncs section, select the Optimizely sync.
  3. Fill out the following fields:
    1. Cookie Lifetime (in days) – How long the Optimizely user ID remains in first-party storage before expiring and re-syncing. Example: 365.
  4. Scroll down and click the Save and Build File button.
  5. Deploy your AJS file to propagate changes to your web property.

What’s Next

If applicable, proceed with setting up your Optimizely Starter Kit.