On this page

For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

Missing or mistimed exposure: engineering solution

Track exposure when a user encounters an experiment variant. Choose the tracking method that matches your Experiment evaluation mode. Data Assistant can't create or retime exposure events. Changing an analysis setting can't recover exposures that your implementation never sent. Start with the findings from the exposure audit.

Choose the exposure method

  • For a supported client-side Experiment SDK, integrate the Experiment SDK with the matching Analytics SDK. The integration tracks exposure when application code accesses the variant from the variant store.
  • For remote evaluation, Amplitude automatically tracks assignment events for eligible requests. Track exposure separately when the user encounters the variant. Alternatively, use the assignment event as an exposure heuristic when the event represents the user's experience.
  • For server-side local evaluation, use the assignment event as an exposure heuristic when the event represents the user's experience. Otherwise, send an explicit exposure when the user encounters the variant. Server-side local evaluation doesn't detect when the client renders the experience.
  • For custom exposure tracking, send the event only when the user experiences the variant. Don't send exposures for fallback or default values when the user has no assignment.

Correct common implementation problems

  1. Keep the user_id and device_id values consistent across evaluation, exposure, and analytics events whenever those identifiers are present.
  2. Fetch or evaluate the variant again when the signed-in identity changes.
  3. Access or log the variant when the application renders or uses it, not during an unused preload.
  4. Send the required flag key and the actual variant value. Follow the exposure event definition.
  5. Avoid duplicate exposure calls for one unchanged experience.

Validate the fix

Run the exposure audit with test accounts in each variant. Confirm the evaluation, exposure, and analytics event sequence before you rely on experiment metrics. Refer to Exposure tracking for supported SDK and API paths.

Was this helpful?