---
title: "What does the RevenueDot webhook event EXPERIMENT_ENROLLMENT mean?"
description: "EXPERIMENT_ENROLLMENT is sent once per customer and experiment when a customer joins an offering experiment. It carries no app, so app-scoped webhooks do not get it."
url: https://revenuedot.app/docs/webhooks/webhook-experiment-enrollment
---

# What does the RevenueDot webhook event EXPERIMENT_ENROLLMENT mean?

The RevenueDot webhook event EXPERIMENT_ENROLLMENT means a customer joined an offering experiment.

## Quick facts

| | |
|---|---|
| Event | `EXPERIMENT_ENROLLMENT` |
| Where | RevenueDot webhook (`event.type`), RevenueCat's webhook format |
| Sent to | Every enabled webhook whose filters match |
| Fields that are specific to it | `experiment_id`, `experiment_variant`, `offering_id`, `experiment_enrolled_at_ms` |
| What it means | A customer joined an offering experiment: the first offerings request that enrolled them. Sent once per customer and experiment, as a production event with no app. |

## When it is sent

- The first offerings request of a customer that matches an experiment's targeting enrolls them in a variant.
- It is sent once per customer and experiment.
- It is a production event with no app, so a webhook set to sandbox only, or to one app, does not get it.

## What your server should do

1. Store the `experiment_id` and `experiment_variant` (`a` is the control) against the customer so your analytics can split results.
2. Do not use it to grant anything.
3. Use a webhook set to production and all apps if you need it.
4. Deduplicate on `event.id`: deliveries can repeat, because anything but HTTP 200 is retried after 5, 10, 20, 40 and 80 minutes.

## Example

```javascript
import { createHmac, timingSafeEqual } from "node:crypto";

// X-RevenueCat-Webhook-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">
function verify(rawBody, header, secret, toleranceSeconds = 300) {
  const m = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header ?? "");
  if (!m || Math.abs(Date.now() / 1000 - Number(m[1])) > toleranceSeconds) return false;
  const expected = createHmac("sha256", secret).update(`${m[1]}.${rawBody}`).digest();
  return timingSafeEqual(expected, Buffer.from(m[2], "hex"));
}

// Sign a sample delivery the way RevenueDot does, then handle it.
const secret = "whsec_test_secret";
const rawBody = JSON.stringify({ api_version: "1.0", event: {"id":"66339910-3BFF-49F4-B873-D1283D673DE2","type":"EXPERIMENT_ENROLLMENT","app_user_id":"user_1","product_id":"pro_monthly","experiment_id":"exp_1","experiment_variant":"b"} });
const t = Math.floor(Date.now() / 1000);
const header = `t=${t},v1=${createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex")}`;

const seen = new Set(); // use a database table in production

function handle(rawBody, header) {
  if (!verify(rawBody, header, secret)) return "401 bad signature";
  const { event } = JSON.parse(rawBody);
  if (seen.has(event.id)) return "200 duplicate";
  seen.add(event.id);
  if (event.type !== "EXPERIMENT_ENROLLMENT") return "200 ignored";
  return "record " + event.app_user_id + " in " + event.experiment_id + " variant " + event.experiment_variant;
}

console.log(handle(rawBody, header));
```

*Run-checked: `npm run check:snippets` runs this snippet with Node and compares its output with `variant b` (checked 2026-10-03).*

## How RevenueDot produces it

`services/targeting.ts` records it with `recordRawEvent` in the experiment shape (no `app_id`, no subscriber attributes) the first time a customer is enrolled.

## Related

- [What does the RevenueDot webhook event INITIAL_PURCHASE mean?](https://revenuedot.app/docs/webhooks/webhook-initial-purchase.md)
- [What does the RevenueDot webhook event TEST mean?](https://revenuedot.app/docs/webhooks/webhook-test.md)
- [What does the RevenueDot webhook event TRANSFER mean?](https://revenuedot.app/docs/webhooks/webhook-transfer.md)
- [EXPERIMENT_ENROLLMENT fields and a recorded example payload](https://revenuedot.app/docs/api/webhook-events.md#experiment_enrollment)
- [Webhooks guide: set up, verify and test](https://revenuedot.app/docs/guides/webhooks.md)

## Source

- [RevenueDot docs: which webhook events RevenueDot sends](https://revenuedot.app/docs/api/webhook-events)
- [RevenueCat: webhook event types and fields (the format RevenueDot follows)](https://www.revenuecat.com/docs/integrations/webhooks/event-types-and-fields)
- [RevenueDot core: events.ts (the event types and the rules that derive them)](https://github.com/revenuedot/revenuedot/blob/main/packages/core/src/events.ts)
- [RevenueDot server: services/targeting.ts](https://github.com/revenuedot/revenuedot/blob/main/apps/server/src/services/targeting.ts)
- [RevenueDot server: services/events.ts (how an event is recorded and delivered)](https://github.com/revenuedot/revenuedot/blob/main/apps/server/src/services/events.ts)

Checked: 2026-10-03
