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

1

Go to Project Settings > Integrations

Open your project, click Settings, then open the Integrations tab.

2

Turn on Mixpanel

Find the Mixpanel card and switch it on.

3

Choose anything else you want sent

Under Also send, tick conversions, purchases, or recommendation events. Experiment views are always sent.

4

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:

TypeScript
// `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'});
TypeScript8 lines

Anything else you switch on carries the same two properties plus the details for that kind of event:

EventDefault nameExtra properties
Experiment view$experiment_startednone
Conversionavsb_goalgoal_key, plus revenue or value when you sent one
Purchaseavsb_purchaserevenue, currency, transaction_id
Recommendation seenavsb_rec_impressionthe recommendation details, such as recipe and items
Recommendation clickedavsb_rec_clickthe 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.

Two property names have to stay exactly as they are

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 name to compare groups.
  • Funnels: start a funnel with $experiment_started and add your conversion steps, then compare by Variant 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.
Your own user IDs come along

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.

Counts will not match exactly

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.

Was this helpful?