Optimizely Feature Experimentation (formerly Optimizely Full Stack) is a powerful A/B testing, feature flagging and experimentation platform. It allows you to track every aspect of your customer's overall product journey, and experiment with various application features.
Getting started
RudderStack supports sending events to Optimizely via the following connection modes:
| Connection Mode | Web | Mobile | Server |
|---|---|---|---|
| Device mode | - | Supported | - |
| Cloud mode | - | - | - |
Once you have confirmed that the source platform supports sending events to Optimizely, follow these steps:
- From your RudderStack dashboard, add the source. Then, from the list of destinations, select Optimizely Full Stack.
- Assign a name to your destination and click Continue.
Connection settings
To successfully configure Optimizely Feature Experimentation as a destination, you will need to configure the following settings:
- Track Known Users: Optimizely does not alias known and unknown users. Therefore, RudderStack will send the
anonymousIdto Optimizely by default if this setting is disabled. Otherwise, theuserIdwill be sent. - Send the experiment and variation information as properties on a track call: By enabling this setting, the experiment data can be sent to the other destinations as a
trackcall. This is done by triggering theExperiment Viewedevent every time an Optimizely live variable is accessed. - Specifies the experiment viewed as non interaction event for Google Analytics: Enabling this option sends
Experiment Viewedas a non-interaction event.
Configure the settings according to your requirements and click Next to complete the setup.
Implementation Prerequisites
Unlike other destinations, Optimizely Feature Experimentation for the mobile integration works a little differently. You will have to implement some Optimizely functions natively to make sure the experiment logic runs correctly.
track calls with Optimizely's track calls. You need to implement all the Optimizely's decision-based methods like activate and isFeatureEnabled natively. For more details, refer to Optimizely's Easy Event Tracking blog and the Optimizely SDK reference Guide.Adding Optimizely to your mobile project
- Add the following
repositoryto yourapp/build.gradlefile.repositories {mavenCentral()} - After that, add the following
dependencyin the same file:implementation 'com.rudderstack.android.integration:optimizely:0.1.1'implementation 'com.optimizely.ab:android-sdk:3.0.0' - Initialize the Optimizely Manager:Optimizely recommends initializing their SDK as soon as possible. You need to initialize the Optimizely Manager before proceeding to the next step. Refer to the Optimizely Initializing the SDK guide for more information.val optimizelyManager = OptimizelyManager.builder().withSDKKey(<YOUR OPTIMIZELY SDK KEY>).build(this)
- Finally, change the initialization of your
RudderClientin yourApplicationclass:val rudderClient = RudderClient.getInstance(this,<YOUT_WRITE_KEY>,RudderConfig.Builder().withEndPointUri(<YOUR_DATA_PLANE_URL>).withFactory(OptimizelyIntegrationFactory.FACTORY(optimizelyManager).build())Make sure you pass the Optimizely manager instance you created in the previous step to the factory as shown in the above snippet above.
- Go your
Podfileand add theRudder-Optimizelyextensionpod 'Rudder-Optimizely' - After adding the dependency followed by
pod install, you can add the imports to yourAppDelegate.mfile as shown:#import "RudderOptimizelyFactory.h" - Finally, change the initialization of your
RudderClientas shown:RSConfigBuilder *builder = [[RSConfigBuilder alloc] init];[builder withDataPlaneUrl:DATA_PLANE_URL];// Setup optimizely logger.OPTLYLoggerDefault *optlyLogger = [[OPTLYLoggerDefault alloc] initWithLogLevel:OptimizelyLogLevelAll];// Create an Optimizely managerself.optlyManager = [[OPTLYManager alloc] initWithBuilder:[OPTLYManagerBuilder builderWithBlock:^(OPTLYManagerBuilder * _Nullable builder) {builder.sdkKey = @<SDK KEY>;builder.logger = optlyLogger;}]];[builder withFactory:[RudderOptimizelyFactory instanceWithOptimizely:self.optlyManager]];[builder withLoglevel:RSLogLevelDebug];[RSClient getInstance:WRITE_KEY config:[builder build]];
Contact us
For more information on the topics covered on this page, email us or start a conversation in our Slack community.