Optimizely X Tracking Module
Requirements
- Optimizely X iOS SDK added to your app
Install
To install the Optimizely X Tracking module, following these steps:
Download the Optimizely X tracking module.
Add the
TealiumIOSOptimizely.framework
file into your Xcode project (in the Embedded Binaries section of your project settings).
Learn more about the Optimizely X Library.
Initialize
The Optimizely X Tracking module must be initialized after the standard Tealium instance is created.
Initialize the TealiumOptimizelyTracker
instance by passing the Tealium instance and providing an instance name:
// Initialize the Tealium Optimizely instance
TealiumOptimizelyTracker * optimizelyTracker = [TealiumOptimizelyTracker tealium];
[optimizelyTracker addInstanceWithName:@"INSTANCE_KEY"];
No additional configuration is needed. The module listens for notifications from the Optimizely SDK and pass the data to Tealium Collect as required.
Track
There are two types of Optimizely events that are passed along to Tealium Collect: experiments and custom events.
These events are captured by Tealium with the following event names:
tealium_event="Optimizely Experiment Started"
When the Optimizely SDK activates an experiment.tealium_event="Optimizely Event Tracked"
When the Optimizely SDK receives a custom event (generated by manually calling Optimizely’strack
method).
Data Layer
The following event attributes are included in the tracked events:
Variable | Scope | Description | Example |
---|---|---|---|
optimizely_experiment_key |
Volatile (session) | Optimizely experiment name | "Homescreen MVT" |
optimizely_variation_key |
Volatile (session) | Optimizely variation name | "Variation A" |
optimizely_user_id |
Volatile (session) | Optimizely user ID | "ralph@tealium.com" |
optimizely_event_key |
Hit (single event) | Optimizely event name | "purchase" |
optimizely_event_value |
Hit (single event) | Optimizely event value | "123" - integer values only |
optimizely_XXX |
Hit (single event) | Optimizely custom attribute prefix. All custom attributes are prefixed with “optimizely_” and passed directly to Tealium |
Override Default Names
Override the default variable names if you prefer a different naming convention. To override variable names change the public properties in the TealiumOptimizelyTracker
class:
TealiumOptimizelyTracker * optimizelyTracker = [TealiumOptimizelyTracker sharedInstance];
[optimizelyTracker addInstanceWithName:@"INSTANCE_NAME"];
optimizelyTracker.TEOptimizelyUserIdKeyName = @"USER_ID_KEY_NAME";
optimizelyTracker.TEOptimizelyExperimentKeyName = @"EXPERIMENT_KEY_NAME";
optimizelyTracker.TEOptimizelyVariationKeyName = @"VARIATION_KEY_NAME";
optimizelyTracker.TEOptimizelyEventKeyKeyName = @"EVENT_NAME_KEY_NAME";
optimizelyTracker.TEOptimizelyEventValueKeyName = @"EVENT_VALUE_KEY_NAME";