Optional
experiment_(Optional) The experiment key used to differentiate between multiple experiments associated with the same flag.
(Required) The key for the flag the user was exposed to.
Optional
metadata?: Record<string, unknown>(Optional) Flag, segment, and variant metadata produced as a result of evaluation for the user. Used for system purposes.
Optional
variant?: string(Optional) The variant the user was exposed to. If null or missing, the event will not be persisted, and will unset the user property.
Event object for tracking exposures to Amplitude Experiment.
This object contains all the required information to send an
$exposure
event through any SDK or CDP to experiment.The resulting exposure event must follow the following definition:
Where
<flagKey>
,<variant>
, and<expKey>
are the flag_key, variant, and experiment_key variant members on this type:For example, if you're using Segment for analytics: