Optimizely Full Stack Destination
Destination Info
- Accepts Page, Identify and Track calls.
- In Cloud-mode, refer to it as Optimizely X, or Optimizely Full Stack in the Integrations object
- In Device-mode, refer to it as Optimizely X in the Integrations object
Segment's Optimizely Full Stack destination, previously Optimizely X, supports the following Optimizely products:
- Optimizely Full Stack (server).
- Optimizely Full Stack Android (Cloud-mode).
- Optimizely Full Stack iOS (Cloud-mode).
If you're interested in implementing Optimizely X Web or Optimizely Full Stack with the JavaScript SDK, see Segment's Optimizely Web Destination, or follow the links below:
Optimizely works differently than other Segment destinations. It requires that customers implement some Optimizely functionality natively to make sure the experiment logic runs correctly.
Segment maps Track events to Optimizely's track method, customers must implement all Optimizely decision-based methods, such as activate and isFeatureEnabled natively. Segment's API doesn't include methods that correspond to decision-based methods.
This requires that customers include a native Optimizely implementation before their Segment implementation on pages or in mobile apps where Optimizely experiments run.
- In your Segment source dashboard, enable the "Optimizely Full Stack" destination (not the "Optimizely Web" destination).
- Include your Optimizely project's
datafileURL in your Segment settings. - Create a native Optimizely instance in your server environment so you can access Optimizely decisioning methods like
activate,isFeatureEnabled. - Finally, define any
eventsandattributesin your Optimizely dashboard, and to associatemetricswith the appropriate Optimizely Experiments. Segment maps Track event names to OptimizelyeventName- theeventNamecorresponds to an experimentmetric. In addition, Segment maps Track eventcontext.traitsto Optimizelyattributes.
Optimizely SDKs v1.x or v2.x require matching attributes objects for correct attribution
If you use Optimizely SDKs v1.x or v2.x and use any activate or isFeatureEnabled calls, the attributes object for each user must match the attributes object passed to any Track calls for that user ID so that it can be correctly attributed on the Optimizely results page.
If you are using Optimizely SDKs v3+, Easy Event Tracking is enabled by default for decision events. Set up does not require maintaining the attributes of a user as long as the user ID stays the same between Optimizely activate and isFeatureEnabled calls and Segment Track calls to have Optimizely metrics populated in the Optimizely results page. If you would like to segment your Optimizely results by user attribute, then make sure the attributes passed in for the activate and isFeatureEnabled calls match the attributes passed in for the Track calls for that user id.
For more details on how events are attributed on the Optimizely results page, refer to Optimizely's documentation on How Optimzely Experimentation counts conversions.
Upon invocation of a Segment Track event, Segment maps the event to an Optimizely track event:
- If the Segment event name matches exactly the name of an active experiment
metricset up in the Optimizely dashboard. - If the experiment
metricis associated with a running experiment. - If the current user has been assigned a
userIdusing Segment's Identify method (for example,analytics.identify('123')). - If the current user is activated in a running experiment with the associated
metric.
Segment also handles the following mapping:
- Segment Track event name to Optimizely
eventName. - Segment Track event
propertiesto OptimizelyeventTags. - Segment Track event
context.traitsto Optimizelyattributes.
revenue values should be passed as a Segment property. The value should be an integer and represent the value in cents. For example, $1 should be represented by 100.
Custom Event Tags are not displayed on the Optimizely results page
Optimizely's Custom Event Tags, which include all Event Tags except revenue and value, are not displayed on the Optimizely results page. However, these tags are available in a Data Export report. Event Tags can be strings, integers, floating point numbers, or boolean values. Optimizely rejects events with any other data types (for example, arrays).
Segment defaults to identifying users with their anonymousId. Enabling the Use User ID setting in your Segment settings means that only Track events triggered by identified users are passed downstream to Optimizely. You may optionally fall back to anonymousId when userId is unavailable by setting fallbackToAnonymousId to true.
Segment's server-side integration with Optimizely Full Stack does not support notification listeners for SegmentTrack events. Notification listeners are still available with any native call invoked from your Optimizely client instance.
- In your Segment source dashboard, enable the "Optimizely Full Stack" destination (not the "Optimizely Web" destination).
- Include the latest version of Optimizely Full Stack's native SDK in your your app-level build.gradle file and implement Optimizely as your would natively.
- Finally, define any
eventsandattributesin your Optimizely dashboard, and associatemetricswith the appropriate Optimizely Experiments. Segment maps Track event names to OptimizelyeventName- theeventNamecorresponds to an experimentmetric. In addition, Segment maps Identifytraitsto Optimizelyattributes.
When implementing Optimizely Full Stack using cloud-mode, Segment maps Track events to Optimizely Track events on our servers and deliver the data to your Optimizely project as usual.
warning "Optimizely SDKs v1.x or v2.x require matching
attributesobjects for correct attribution" If you use Optimizely SDKs v1.x or v2.x and use anyactivateorisFeatureEnabledcalls, theattributesobject for each user must match theattributesobject passed to any Track calls for that user id so that it can be correctly attributed on the Optimizely results page.
If you are using Optimizely SDKs v3+, Easy Event Tracking is enabled by default for decision events. Set up does not require maintaining the attributes of a user as long as the user id stays the same between Optimizely activate and isFeatureEnabled calls and Segment Track calls to have Optimizely metrics populated in the Optimizely results page. If you would like to segment your Optimizely results by user attribute, then make sure the attributes passed in for the activate and isFeatureEnabled calls match the attributes passed in for the Track calls for that user id.
For more details on how events are attributed on the Optimizely results page, refer to Optimizely's documentation on How Optimzely Experimentation counts conversions.
Upon invocation of a Segment Track event, Segment maps the event to an Optimizely Track event:
- If the Segment event name matches exactly the name of an active experiment
metricset up in the Optimizely dashboard. - If the experiment
metricis associated with a running experiment. - If the current user is activated in a running experiment with the associated
metric.
Segment also handles the following mapping:
- Segment Track event name to Optimizely
eventName. - Segment Track event
propertiesto OptimizelyeventTags.
revenue values should be passed as a Segment property. The value should be an integer and represent the value in cents. For example, $1 should be represented by 100.
Custom Event Tags are not displayed on the Optimizely results page
Optimizely's Custom Event Tags, which include all Event Tags except revenue and value, are not displayed on the Optimizely results page. However, these tags are available in a Data Export report. Event Tags can be strings, integers, floating point numbers, or boolean values. Optimizely rejects events with any other data types (for example, arrays).
Segment defaults to identifying users with their anonymousId. Enabling the Use User ID setting in your Segment dashboard means that only Track events triggered by identified users are passed downstream to Optimizely. You may optionally fall back to anonymousId when userId is unavailable by setting fallbackToAnonymousId to true.
Invoking a Segment Identify event sets Segment traits as Optimizely attributes. The attributes are sent downstream to Optimizely upon invocation of the next Segment Track event.
Invoking this method invalidates the listener for the Experiment Viewed event.
If you want to use Optimizely's notification listeners, you must use the Optimizely native code to invoke them (in addition to using the Segment SDKs). Notification listeners require an instantiated Optimizely client to be accessed, and so are not available for Segment Track events when you connect to Optimizely using cloud-mode.
- In your Segment source dashboard, enable the "Optimizely Full Stack" destination (not the "Optimizely Web" destination).
- Include the latest version of Optimizely Full Stack's native SDK in your app and implement it as you would natively.
- Finally, define any
eventsandattributesin your Optimizely dashboard, and to associatemetricswith the appropriate Optimizely Experiments. Segment maps Track event names to OptimizelyeventName- theeventNamecorresponds to an experimentmetric. In addition, Segment maps Identifytraitsto Optimizelyattributes.
When implementing Optimizely using cloud-mode, Segment mapS Track events to Optimizely Track events on our servers and deliver the data to your Optimizely project as usual.
Optimizely SDKs v1.x or v2.x require matching attributes objects for correct attribution
If you use Optimizely SDKs v1.x or v2.x and use any activate or isFeatureEnabled calls, the attributes object for each user must match the attributes object passed to any Track calls for that user id so that it can be correctly attributed on the Optimizely results page.
If you are using Optimizely SDKs v3+, Easy Event Tracking is enabled by default for decision events. Set up does not require maintaining the attributes of a user as long as the user id stays the same between Optimizely activate and isFeatureEnabled calls and Segment Track calls to have Optimizely metrics populated in the Optimizely results page. If you would like to segment your Optimizely results by user attribute, then make sure the attributes passed in for the activate and isFeatureEnabled calls match the attributes passed in for the Track calls for that user id.
For more details on how events are attributed on the Optimizely results page, refer to Optimizely's documentation on How Optimzely Experimentation counts conversions.
Upon invocation of a Segment Track event, Segment maps the event to an Optimizely Track event:
- If the Segment event name matches exactly the name of an active experiment
metricset up in the Optimizely dashboard. - If the experiment
metricis associated with a running experiment. - If the current user is activated in a running experiment with the associated
metric.
Segment also handles the following mapping:
- Segment Track event name to Optimizely
eventName. - Segment Track event
propertiesto OptimizelyeventTags.
revenue values should be passed as a Segment property. The value should be an integer and represent the value in cents. For example, $1 should be represented by 100.
Custom Event Tags are not displayed on the Optimizely results page
Optimizely's Custom Event Tags, which include all Event Tags except revenue and value, are not displayed on the Optimizely results page. However, these tags are available in a Data Export report. Event Tags can be strings, integers, floating point numbers, or boolean values. Optimizely rejects events with any other data types (for example, arrays).
Segment defaults to identifying users with their anonymousId. Enabling the Use User ID setting in your Segment dashboard means that only Track events triggered by identified users are passed downstream to Optimizely. You may optionally fall back to anonymousId when userId is unavailable by setting fallbackToAnonymousId to true.
Invoking a Segment Identify event sets Segment traits as Optimizely attributes. The attributes are sent downstream to Optimizely upon invocation of the next Segment Track event.
Notification listeners are not available for Segment Track events when implementing Optimizely using Segment using cloud-mode. Notification listeners are still available with any native call invoked from your Optimizely client instance.
Follow these instructions on how to set up Engage and Optimizely:
Segment supports deleting or rsuppressing users in Optimizely using the Segment app. In order to do this however, you need to create a Personal Access Token in Optimizely and provide it as the value of the Access Token setting.
Segment lets you change these destination settings from the Segment app without having to touch any code.
Optional
In order to use Optimizely X via server side, you must enter your Account ID from your Optimizely account. You can find this ID by visiting https://app.optimizely.com/v2/accountsettings/account/plan
Optional
To optimize the server side integration, we will cache the fetched Datafile that you have provided for this amount of time (in seconds) in Redis. Since the datafile should not change unless you modified the conditions or variation rules of your experiments, it is advised to have a minimum floor of 300 seconds (5 minutes).
300Optional
In order to use Optimizely X server side, you must enter the entire URL for your datafile. It should look something like https://cdn.optimizely.com/json/9218021209.json
Optional
Optionally fall back to anonymousId when userId is not present.
falseOptional
Send experiment data to other tools (as a track call). An "Experiment Viewed" track event will be triggered each time you access an Optimizely live variable. If you're regularly accessing live variables and want to reduce the number of track events triggered, pass the "false" flag, for example our Android library would be:
Boolean myVariable = optimizelyClient.getVariableBoolean("myVariable",
userId,
false);
And for our iOS library:
bool myVariable = [optimizely variableBoolean:@"myVariable"
userId:userId]
activateExperiment:False];
trueOptional
Send Experiment Viewed as a non-interaction event
trueOptional
Optimizely does not alias known and unknown users. By default, Segment will only send the anonymousId to Optimizely. Enable this to only send the userId to Optimizely. Important: This setting only applies if you are bundling this integration for mobile sources.
falseOptional
Enable this setting to instantiate an Optimizely client using v3.2.2 of Optimizely's SDK. The default Optimizely client version Segment instantiates is v2.1.3. NOTE: Do not enable this setting if the SDK version you are using to activate users into your Optimizely experiments is less than 3.0. You can find more information on how migrating from Optimizely 2.x to 3.x will affect your experiment tracking in Optimizely's documentation: https://docs.developers.optimizely.com/full-stack/docs/changelog#section-may-2019
falseOptional
Enable this if you want the server side integration to use Optimizely User ID instead of User ID or anonymous ID in your calls. You can include Optimizely User ID in your calls via integrations.['Optimizely X'].optimizelyUserId or integrations.['Optimizely Full Stack'].optimizelyUserId.
falseOptional
Enable this if you want the server side integration to use User ID instead of anonymous ID in your identify calls
false