Heap Integration
The Heap integration tracks experiment enrollment events in Heap with experiment and variation metadata as event properties. Once connected, you can use Heap's charts, funnels, and retention analysis to compare behavior between experiment variations using all the data Heap has already captured.
Setup
1
Go to Project Settings > Integrations
Open your project, click Settings, then click the Integrations tab.
2
Enable Heap
Find the Heap card and toggle it on.
3
Enter your App ID (optional)
Enter your Heap App ID. You can find this in your Heap account under Account > Privacy & Security or in the Heap tracking snippet. If your site already has the Heap snippet installed (which sets
window.heap), you can leave this blank and A vs B will auto-detect the initialized Heap instance.4
Save
Click Save. Events will be tracked in Heap starting with the next experiment enrollment.
What is sent to Heap
When a visitor is enrolled in a variation, A vs B calls:
javascript
1heap.track('avsb_experiment', {2 experiment_id: 'exp_abc123',3 experiment_name: 'Homepage Hero Test',4 variation_id: 'var_xyz789',5 variation_name: 'Variation B',6 event_name: 'experiment_viewed'7});Viewing in Heap
After the integration is running, experiment events appear in Heap as custom events named avsb_experiment. You can use Heap's analysis features to break down behavior by experiment variation:
- Charts — create a user count or event count chart, then add a breakdown by the
variation_nameproperty to compare activity between groups. - Funnels — build a funnel starting with the
avsb_experimentevent and add your conversion steps. Break down byvariation_nameto compare conversion rates. - Retention — analyze whether visitors assigned to a specific variation had better retention over the following days or weeks.
- Paths — compare the navigation paths taken by visitors in each variation after being enrolled.
Heap autocapture + experiment data
Heap automatically captures all user interactions on your site without requiring custom event code. By combining Heap's autocaptured events with A vs B experiment enrollment events, you can analyze the full behavioral impact of your experiment — not just the metrics you explicitly defined.
Tip
Use Heap's
addUserProperties() method in conjunction with the A vs B integration if you want the experiment variation to appear as a persistent user property rather than just an event property. This lets you filter historical data by experiment assignment in Heap user-level reports.