Heap Integration
A vs B sends your experiment data to Heap through the Heap library that is already running on your page. There is no app ID to paste in: if Heap's own track function is on the page, A vs B uses it.
Heap gets two things when a visitor is shown a variation: an event you can chart directly, and an event property that rides along on everything Heap captures afterwards.
Setup
Go to Project Settings > Integrations
Open your project, click Settings, then open the Integrations tab.
Turn on Heap
Find the Heap 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.
What is sent
When a visitor is shown a variation:
// `heap` is the global the Heap snippet installs on the page.declare const heap: { addEventProperties(properties: Record<string, string>): void; track(eventName: string, properties: Record<string, unknown>): void;};heap.addEventProperties({ 'AvsB 482': 'Variant B'});heap.track('AvsB Experiment Viewed', { experiment_id: '482', experiment_name: 'Homepage hero', variation_id: '1913', variation_name: 'Variant B', event_id: '3f9a2b1c-7d4e-4a58-9c02-5e6d1f8b3a47'});The first call is what makes Heap valuable here: from that point in the session, every event Heap captures by itself also carries AvsB 482, so you can split any autocaptured behaviour by variation without tagging anything.
| Event | Default name | Extra properties |
|---|---|---|
| Experiment view | AvsB Experiment Viewed | none, plus the event property described above |
| 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. The event property key is built from the experiment ID and is not renameable, so your Heap segments keep working when you rename an experiment.
A vs B only ever adds event properties. It never calls clearEventProperties, so properties you set yourself are left alone.
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.
Viewing in Heap
- Charts: break any event count down by
AvsB 482(or byvariation_nameon the A vs B events themselves). - Funnels: start with
AvsB Experiment Viewed, add your conversion steps, and split by variation. - Retention: compare whether one variation brought people back more often.
- Journeys: compare the paths visitors took after seeing each variation.
Because the variation rides along as an event property, you can analyse behaviour you never thought to tag, months after the experiment ran.
Your Heap 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 event_id, a unique ID you can use to line individual events up.