Set up analytics platforms
Track analytics on feature flag usage by using a notification listener to send events to the analytics provider of your choice.
When you create flags, you will want to know when users are accessing a feature flag and what experience they receive in production.
Although Optimizely Feature Experimentation does not offer analytics on feature flags out of the box, you can still track analytics on feature flag usage by adding a notification listener to send events to the analytics provider of your choice.
Notification listeners trigger a callback function that you define when specific actions are activated in the SDK.
The most common use case is sending a stream of all feature flag decisions to an analytics provider or an internal data warehouse to join it with other data you have about your users.
To track flag usage:
- Sign up for an analytics provider of your choice (for example, Segment)
- Set up a notification listener.
- Follow your analytics provider's documentation and send events from within the listener callback.
In this section, we suggest implementations for some common analytics platforms. Use these suggestions as presented or adapt them to meet your specific needs.
Analytics integrations let you filter your third-party data by Optimizely Feature Experimentation experiments and variations. This enables you to measure Feature Experimentation experiment performance based on events that the third party tracks. Analytics integrations also let you create custom third-party reports that include only users who saw a particular experiment.
Analytics integrations are conceptually simple, but there are some important considerations in setting up your integration. When a user activates an experiment, you need to notify your third-party analytics service which experiment and variation the user saw.
Generally, each third-party analytics platform has its own event format for this notification. For example, Segment's Experiment Viewed event has expected properties that contain your experiment and variation. With Google Analytics, you can use a non-interaction event with a custom dimension that contains your experiment and variation. Check your third-party analytics platform's documentation to confirm how they expect you to send this information.
For Optimizely Feature Experimentation, you will need to notify your third-party analytics platform when a user sees an experiment, which is when you use Decide. Development teams can make use of our notification listeners to bind this functionality to our client’s Decide method.
If you already implemented an integration but are questioning the data or want to know what third-party data Optimizely Feature Experimentation will support, read about data discrepancies in third-party data.
Audience integrations help you target your Optimizely Feature Experimentation experiments to segments of users that are identified in a third-party data management platform (DMP) like Adobe Audience Manager.
You can target your experiment to users by values for the attributes you have set up in your Optimizely Feature Experimentation project. Add the audience attributes you will target to your project before passing them to Feature Experimentation in your code. For more information, see Define attributes.
After you create the attributes within Optimizely Feature Experimentation, you can pass your DMP's attributes when you build OptimizelyUserContexts. We do not currently offer integrations to handle this audience targeting automatically.
For more information about notification listeners, select the SDK reference guide for your language, and see the documentation on Notification listeners.
Updated 4 months ago