# Amplitude (analytics browser)

### <img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FjZjlHQ21dEIlr3GdaVJt%2FAmplitude_ida8NYsPJK_1.png?alt=media&#x26;token=e956138b-9460-42dd-9fa7-e5e768fd4749" alt="" data-size="line"> What this integration does

Each time a visitor is exposed to an AB Tasty campaign, we add a **timestamped `ABTasty` event** to their Amplitude timeline—no custom wiring. The event carries two fields that tell you exactly what they saw:

* `abtasty_campaign` → `campaignName (campaignId)`
* `abtasty_variation` → `variationName (variationId)`

**,All campaign views are appended**: when an Amplitude **user profile is available**, every exposure is attached to that profile; otherwise the event is recorded against the current device and will surface under the user once they are identified, per Amplitude behavior.

Because it’s an event, you can break down funnels, retention, and cohorts by **campaign** and **variation**, compare variants side‑by‑side, and join experiment exposure with your existing product analytics—all within Amplitude.

***

### Requirements

* [**Amplitude Analytics Browser SDK v2**](#user-content-fn-1)[^1] is installed on your site. *(See “Amplitude Browser SDK 2”.)*
* `window.amplitude` and `window.amplitude.track` are available when AB Tasty runs.
* The connector uses **`amplitude.track()`** to send the `ABTasty` event. *(See “Amplitude track” method.)*

***

### How Campaign Data Is Sent

AB Tasty sends one analytics event  **`ABTasty`** for each campaign exposure. The event payload contains:

* `abtasty_campaign`: `<campaignName> (<campaignId>)`
* `abtasty_variation`: `<variationName> (<variationId>)`

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FmRgLuowwEoV5Af3GwIsH%2F0e47f879-ddda-489e-bbce-863fcc2c1cf8.png?alt=media&#x26;token=a1881062-8260-4d00-8dce-1dae57b997cd" alt=""><figcaption></figcaption></figure>

***

### How to Set Up the Integration (AB Tasty)

1. Go to Integrations → Integration Hub.
2. [Search Amplitude ](#user-content-fn-2)[^2]\(analytics browser) and select it.
3. Click on Create
4. Give the connector a name.
5. *(Optional)* Tick Automatically add to future campaigns.
6. Click Create.

{% hint style="info" %}
👉 If you checked the box, the connector will appear automatically in the Advanced step of your future campaigns. It does not apply retroactively to existing campaigns.
{% endhint %}

***

### How to Check if Events Are Sent Properly

#### Console (Debug Mode)

1. Open your website.
2. Paste this in the browser console:

   `document.cookie = "abTastyDebug=true;path=/;";`
3. Trigger an AB Tasty campaign. You should see a **debug log** indicating the `ABTasty` event was sent.

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2F7ajcEiwYHRSMOXs6Bvge%2F5d842ec3-cbb0-489c-be6a-b3ad9741b7f6.png?alt=media&#x26;token=d5110a8d-8efd-413e-8eed-688b6f93b1c8" alt=""><figcaption></figcaption></figure>

#### Network Tab

1. Open DevTools → **Network**.
2. Filter for requests to:

   `https://api.eu.amplitude.com/2/httpapi`
3. Inspect the payload and confirm `event_properties` include:
   * `abtasty_campaign`
   * `abtasty_variation`

{% hint style="warning" %}
Region endpoints may differ (e.g., US vs EU). Use the endpoint that matches your Amplitude data residency.
{% endhint %}

***

### Retrieve the Event in Amplitude

1. Go to your **Amplitude dashboard**.
2. Open **Live Events**.
3. A new **`ABTasty`** event should appear, attached to the current user.
4. Click the user/event to view details, including:
   * `abtasty_campaign`
   * `abtasty_variation`

***

### Good to Know

* The event is automatically linked to an **Amplitude user ID** (e.g., `user_42`).
  * You may set this yourself (see *Custom User Identifier* in Amplitude docs), or
  * Let Amplitude assign one randomly.
* You can build user cohorts based on `ABTasty` events to group users by the campaigns/variations they saw.
* Works alongside your existing Amplitude events—use `ABTasty` as a breakdown dimension in funnels and retention charts.

***

### FAQ

**Does AB Tasty create users in Amplitude?**\
No. Amplitude creates user profiles according to its standard behaviour when events arrive.

**Can we change the event name or keys?**\
Use the defaults (`ABTasty`, `abtasty_campaign`, `abtasty_variation`) for consistent reporting.

**Is an Amplitude API key needed in AB Tasty?**\
No. This integration utilises your client-side Amplitude SDK, which is already on the site.

[^1]: ![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FLF6oLT5W6EqK7NOdCKxi%2F2e0ddf19-b08f-4a27-bca3-44118997eecf.png?alt=media\&token=abb2682a-805f-44a8-ac8f-9261d2627bfc)

[^2]: ![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FfiOLSSMvTDuTvGe2jtvt%2Fd06cc896-6681-4fa6-aa6d-33bba64b30af.png?alt=media\&token=9f8013ec-3b13-4886-8a74-e6261161abfd)
