Amplitude Integration
A vs B sends your experiment data to Amplitude through the Amplitude SDK that is already running on your page. There is no API key to paste in: if window.amplitude.track is there, we talk to it.
A variant is one specific version being tested: the control, or one of the challengers. Experiment views use Amplitude's own $exposure event to report which variant a visitor saw. Amplitude does not bill for this event, and it fills in the variant user property for you.
Setup
Go to Project Settings > Integrations
Open your project, click Settings, then open the Integrations tab.
Turn on Amplitude
Find the Amplitude card and switch it on.
Choose anything else you want sent
Under Also send, tick conversions, purchases, or recommendation events. Experiment views are always sent.
Save
Click Save. Your changes reach your live site within about a minute.
- The on/off switch, top right of the card.
- The Also send checklist for conversions, purchases, and recommendation events.
What is sent
When a visitor is shown a variant:
// `amplitude` is the global the Amplitude snippet installs on the page.declare const amplitude: { track(eventName: string, properties: Record<string, unknown>): void };amplitude.track('$exposure', { flag_key: '482', variant: 'Variant B', experiment_key: 'Homepage hero', event_id: '3f9a2b1c-7d4e-4a58-9c02-5e6d1f8b3a47'});flag_key, variant, and experiment_key are the three fields Amplitude Experiment reads. Anything else you switch on uses the plainer field names instead:
| Event | Default name | Properties |
|---|---|---|
| Experiment view | $exposure | flag_key, variant, experiment_key, event_id |
| Conversion | avsb_goal | the four experiment and variation fields, event_id, goal_key, plus revenue or value when you sent one |
| Purchase | avsb_purchase | the four experiment and variation fields, event_id, revenue, currency, transaction_id |
| Recommendation seen | avsb_rec_impression | the four fields, event_id, and the recommendation details |
| Recommendation clicked | avsb_rec_click | the four fields, event_id, and the recommendation details |
Empty fields are left out rather than sent as blanks.
A conversion carries the experiment, the variation, and the goal that fired:
amplitude.track('avsb_goal', { experiment_id: '482', experiment_name: 'Homepage hero', variation_id: '1913', variation_name: 'Variant B', event_id: 'b2a7e6c4-1f3a-4d8e-9b02-8c4a2e7f19d0', goal_key: 'click:31'});goal_key identifies which goal fired. For a metric you built in the metric builder, it is the metric's type and short ID joined by a colon, like click:31. For a custom event you track yourself, it is just your event's name.
Renaming events
Every name in the table can be changed on the card. Leave a box empty to keep the standard name shown inside it.
Amplitude does not charge for its own $exposure event, and it fills in the variant user property from it. A custom name loses both. Rename this one only if you have a reason to.
Turning it off
Switch the Amplitude card off to stop sending to Amplitude. To skip just one experiment and keep every other one on, use the Analytics forwarding switch on that experiment's review step.
Check it works
On the Integrations tab, use Send a test event. It opens your site in a new tab and sends one clearly labelled test event, avsb_test_event, to every tool you have switched on. Your project needs at least one live experiment first: the test event is sent against the first one you have.
Viewing in Amplitude
- Experiment results:
$exposurefeeds Amplitude's own experiment analysis with no mapping. - Event Segmentation: chart
$exposureand break it down byvariant. - Funnel Analysis: start with
$exposureand end with your conversion event, split byvariant. - Retention: check whether one variation brought people back more often.
- User Lookup: see which variation any individual was shown.
This integration calls amplitude.track(), which is the Browser SDK v2 API. Sites still on v1 (amplitude.getInstance().logEvent()) will not receive events. Upgrade to v2, or send them yourself from the event bus.
Your Amplitude numbers and your A vs B results will be close but not identical. Ad blockers and consent choices affect the two systems differently. Every event carries event_id, a unique ID you can use to line individual events up.