Mixpanel Integration
A vs B sends your experiment data to Mixpanel through the Mixpanel library that is already running on your page. There is no project token to paste in: if mixpanel.track is a working function on the page, we talk to it.
Experiment views use Mixpanel's own Experiments event shape, so its built in Experiments report understands them straight away.
Setup
Go to Project Settings > Integrations
Open your project, click Settings, then open the Integrations tab.
Turn on Mixpanel
Find the Mixpanel 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, and events appear in Mixpanel within seconds of that.
What is sent
When a visitor is shown a variation:
// `mixpanel` is the global the Mixpanel snippet installs on the page.declare const mixpanel: { track(eventName: string, properties: Record<string, unknown>): void };mixpanel.track('$experiment_started', { 'Experiment name': 'Homepage hero', 'Variant name': 'Variant B', avsb_event_id: '3f9a2b1c-7d4e-4a58-9c02-5e6d1f8b3a47'});Anything else you switch on carries the same two properties plus the details for that kind of event:
| Event | Default name | Extra properties |
|---|---|---|
| Experiment view | $experiment_started | none |
| Conversion | avsb_goal | goal_key, plus revenue or value when you sent one |
| Purchase | avsb_purchase | revenue, currency, transaction_id |
| Recommendation seen | avsb_rec_impression | the recommendation details, such as recipe and items |
| Recommendation clicked | avsb_rec_click | the recommendation details, such as recipe, item, and position |
Empty fields are left out rather than sent as blanks.
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.
Mixpanel's own Experiments report only recognises the properties Experiment name and Variant name with exactly that capitalisation, so A vs B always sends them that way. Renaming the $experiment_started event itself also takes it out of that report, so change it only if you have a reason to.
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. Mixpanel Live Events shows it within a few seconds.
Viewing in Mixpanel
- Experiments report: pick up experiment views automatically, with no property mapping.
- Insights: break any metric down by
Variant nameto compare groups. - Funnels: start a funnel with
$experiment_startedand add your conversion steps, then compare byVariant name. - Flows: see the paths visitors took after being shown each variation.
- Cohorts: build a cohort of everyone shown a specific variation and use it in any report.
If you call Mixpanel's identify() with your own user IDs, A vs B events attach to those same profiles, so you can see which variation a person saw alongside everything else they did.
Your Mixpanel numbers and your A vs B results will be close but not identical, because ad blockers and consent choices affect the two systems differently. Every event carries avsb_event_id, a unique ID you can use to line individual events up.