Interface for enabling tracking Exposures through the ExperimentClient.

If you're using the Amplitude Analytics SDK for tracking you do not need to implement this interface. Simply initialize experiment using the Experiment.initializeWithAmplitudeAnalytics function.

If you're using a 3rd party analytics implementation then you'll need to implement the sending of the analytics event yourself. The implementation should result in the following event getting sent to amplitude:

{
"event_type": "$exposure",
"event_properties": {
"flag_key": "<flagKey>",
"variant": "<variant>",
"experiment_key": "<expKey>"
}
}

For example, if you're using Segment for analytics:

analytics.track('$exposure', exposure)

Hierarchy

  • ExposureTrackingProvider

Methods

Methods

  • Called when the ExperimentClient intends to track an exposure event; either when variant serves a variant (and automaticExposureTracking is true) or if exposure is called.

    The implementation should result in the following event getting sent to amplitude:

    {
    "event_type": "$exposure",
    "event_properties": {
    "flag_key": "<flagKey>",
    "variant": "<variant>",
    "experiment_key": "<expKey>"
    }
    }

    For example, if you're using Segment for analytics:

    analytics.track('$exposure', exposure)
    

    Parameters

    Returns void