/Docs

Amplitude Integration

The Amplitude integration tracks experiment enrollment events in Amplitude with experiment and variation details as event properties. Use Amplitude's Charts, Funnels, and User Lookup to analyze how different experiment variations affected user behavior across your product.

Setup

1

Go to Project Settings > Integrations

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

Enable Amplitude

Find the Amplitude card and toggle it on.
3

Enter your API Key (optional)

Enter your Amplitude API Key. You can find this in Amplitude under Settings > Projects > [Your Project] > General. If your site already has the Amplitude SDK loaded (which sets window.amplitude), you can leave this blank and A vs B will auto-detect the initialized instance.
4

Save

Click Save. Events will begin appearing in Amplitude on the next experiment enrollment.

What is sent to Amplitude

When a visitor is enrolled in a variation, A vs B calls:

javascript
1amplitude.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 Amplitude

After the integration is running, events appear in Amplitude as the event type avsb_experimentwith the experiment and variation details as event properties. You can use these in all of Amplitude's core analyses:

  • Event Segmentation — chart the avsb_experiment event and break it down by variation_name to see enrollment counts over time per variation.
  • Funnel Analysis — build a funnel starting with avsb_experiment and ending with your conversion event. Segment by variation_name to compare conversion rates between groups.
  • Retention Analysis — measure whether visitors in Variation B returned to your product more frequently over the following days compared to the control group.
  • User Lookup — find any individual user and see which variation they were assigned to, alongside their full behavioral history.
Amplitude SDK versions
A vs B supports both Amplitude SDK v1 (amplitude.getInstance().logEvent()) and SDK v2 (amplitude.track()). The snippet auto-detects which version is installed and uses the correct API. If you are on an older version of the Amplitude SDK, consider upgrading to v2 for the best compatibility.
Tip
Amplitude's Experiment product and A vs B serve different use cases. Amplitude Experiment is tightly integrated with Amplitude's feature flag infrastructure, while A vs B provides a visual experiment builder, Bayesian statistics, and a purpose-built results UI. Using A vs B with the Amplitude integration lets you keep your experiment results in A vs B while sending the data to Amplitude for behavioral cohort analysis.