Notification listeners
Notification listeners let you programmatically observe and act on various events that occur within the SDK in Optimizely Feature Experimentation.
Notification listeners
- give you flexibility in implementing custom integrations with analytics providers.
- let you configure integrations by passing data to external services.
- work by triggering a callback function that you define.
Use cases
The following are a few examples for using notification listeners:
- Send data to an analytics service and report feature flag decision data. For example, report that user_123 was assigned to variation A.
- Use SDK events to send alerts to data monitoring tools like New Relic and Datadog to visualize how A/B tests affect service-level metrics.
- Pass all events to an external data tier, like a data warehouse, for additional processing and to leverage business intelligence tools.
- Re-initialize your SDK to quickly retrieve updated feature flag configuration data for your business-critical features.
Notification listeners
Notification listeners in Feature Experimentation work by triggering a callback function that you define and provide at runtime. The following methods or lifecycle events trigger notification listeners if you have implemented the listener:
- Decide methods – Invoke the Decision notification listener if the listener is enabled.
- Track event method – Invokes the Track notification listener if the listener is enabled.
Important
This method does not call the track notification listener when the specified event key is invalid
- Event batch flushed – Invokes the Log event notification listener if the listener is enabled.
- New datafile retrieved – Invokes the OptimizelyConfigUpdate notification listener if this listener is enabled.
Updated 28 days ago