Exposure tracking in Amplitude Experiment

This article helps you:

  • Learn how Amplitude Experiment tracks user exposures

When running an experiment, tracking which users were exposed to your feature flag's variable experience is essential. Without it, you can't count on reliable results.

Note

Exposure tracking is optional for feature flags that don't require analysis.

Analytics REST API

In this example, the Analytics REST API v2.0 sends an exposure event to Amplitude with curl.

1curl --request POST \
2 --url '' \
3 --data '{"api_key":"","events":[{"event_type":"$exposure","user_id":"","event_properties":{"flag_key":"","variant":""}}]}'

When the request succeeds, a user appears in the Exposures chart in Amplitude Experiment.

The flag is now active in your deployment, and your experiment has evaluated a user and shown them the variant.

SDKs

As with fetching variants, you can simplify exposure tracking using a client-side Experiment SDK in your app. Client-side Amplitude Experiment SDKs can automatically track exposures through your installed analytics SDK whenever it accesses a variant from the variant store.

Was this page helpful?

Thanks for your feedback!

August 28th, 2024

Need help? Contact Support

Visit Amplitude.com

Have a look at the Amplitude Blog

Learn more at Amplitude Academy

© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.