Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion docs/experiments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,41 @@ You can specify the event and property that should be used as the exposure event
![image](/images/exp_settings_rescale.png)
</Frame>

#### Sending multiple experiments in a single exposure event

By default, each `$experiment_started` event records a single experiment and its variant. If a user is exposed to several experiments at the same time, you can instead record all of them on one exposure event, rather than sending a separate event per experiment.
Comment thread
greptile-apps[bot] marked this conversation as resolved.

To enable this, open the **Experiment Event Format** settings and set **Experiments in each Exposure Event** to **More than one**. When you do, the **Experiment and Variant format** options change from "Separate values"/"Combined value" to **Dictionary (Key-value pairs)** or **List (Ordered values)**. The exposure event name stays `$experiment_started` in every case.

**Dictionary (Key-value pairs):** each experiment key becomes a property key on the event, and its value is the variant key the user was bucketed into for that experiment:

```json
{
"event": "$experiment_started",
"properties": {
"[Experiment Key]": "[Variant Key]",
"[Another Experiment Key]": "[Another Variant Key]"
}
}
```

**List (Ordered values):** experiments are recorded as an ordered array under a single list property (default key `Experiments`), where each entry pairs the experiment key with its variant key joined by a configurable **String Separator** (default `:`), i.e. `[Experiment Key]:[Variant Key]`:

```json
{
"event": "$experiment_started",
"properties": {
"Experiments": [
"[Experiment Key]:[Variant Key]",
"[Another Experiment Key]:[Another Variant Key]"
]
}
}
```

### When to track an exposure event?
- An exposure event ONLY needs to be sent the first time a user is exposed to an experiment, as long as the user is always in the initial bucketed variant. Exposure events don’t have to be sent subsequently in new sessions.
- If a user is part of multiple experiments, send a corresponding exposure event for each experiment.
- If a user is part of multiple experiments, by default send a separate exposure event for each experiment. Alternatively, if you set **Experiments in each Exposure Event** to **More than one** in the **Experiment Event Format** settings, you can record all of a user's experiments on a single exposure event (see "Sending multiple experiments in a single exposure event" above).
- Send exposure event only when a user is actually exposed, not at the start of a session.

For example, if you want to run an experiment on the payment page of a ride-sharing app, you only really care about users who open the app, book a ride, and then reach the payment page. Users who only open the app and do other activities shouldn't be considered in the sample size. So exposure event should ideally be implemented to track only once the payment page is reached.
Expand Down