# Mixpanel

<img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FZaMdrLT5N4OuK3SRne9j%2FMixpanel_Symbol_1.png?alt=media&#x26;token=ec3fc11f-551f-497b-ae40-3f67fbd7c5f9" alt="" data-size="line">Mixpanel is a product analytics platform that helps teams understand how users interact with their digital products. It tracks events, user behaviour, and retention in real time. With powerful segmentation and funnel tools, it supports data-driven decisions. You can find their getting-started guide [***here*** ](https://help.mixpanel.com/hc/en-us/sections/360006013852-Getting-Started)and the official partnership page[ ***here***](https://mixpanel.com/partners/integrations/ab-tasty)*.*\
\
Easily activate the AB Tasty + Mixpanel integration to enable powerful, automated analysis of your experiments.\
Follow this guide to streamline your setup and unlock advanced reporting features—no manual configuration needed.

## How to Set up the Integration <a href="#h_01gpkg5w4xnkgjg6h7bj5sfw5r" id="h_01gpkg5w4xnkgjg6h7bj5sfw5r"></a>

{% stepper %}
{% step %}

### On AB Tasty

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FH17SBdm8XOlLg5d7PQz1%2FCapture%20d%E2%80%99e%CC%81cran%202025-07-18%20a%CC%80%2014.51.52.png?alt=media\&token=3030bd6d-6672-4587-8d1c-89ae7b5ad163)

1. **Ensure** you have sufficient rights to create integrations
2. Access **Integrations > Integration Hub**.
3. Search for and select **Mixpanel (Push)**
4. Click **Create**  (or create connector on the side panel)&#x20;
5. Give a name to your connector and activate it
6. \[Optional] Check this box to add the connector to your future campaigns automatically.
7. Click **Save and create a connector.**

If you have checked the box, the connector will be automatically added to the Advanced step of your future campaigns. However, it is not applied retroactively to previously created campaigns.

If you left the box unchecked (default behavior), your connector won't be added automatically. You can still decide to send campaign data to your connector by selecting it from the *Advanced options* step of your campaign. More information on how to link a campaign is can be found in the [Advanced Options Step ](https://docs.abtasty.com/web-experimentation-and-personalization/campaign-flow-advanced-options)article.

You can also modify this behavior from the Integration hub, by editing your connector configuration (check or uncheck box).

{% hint style="warning" %}
**Heads up ⚡**\
You must update the AB Tasty tag to make your changes live.
{% endhint %}
{% endstep %}

{% step %}

### On Mixpanel

You can follow their documentation [here](https://docs.mixpanel.com/docs/cohort-sync/integrations/abtasty). \
You'll get an abstract below

{% hint style="info" %}
**Good to Know 💡**\
This integration relies on the presence of the Mixpanel SDK in the webpage's global scope. You can make sure this is the case by running **window\.mixpanel** in your developer tool console. If it isn’t undefined, the integration can work.
{% endhint %}

**How AB Tasty Data Arrives**

When the integration is active, AB Tasty sends a single event to Mixpanel named `"Event"` for users exposed to a test. This event contains one property, `"AB Tasty"`, which holds a concatenated string of the campaign and variation IDs. For example: `[12345]My Homepage Test[67890]Variation B`.

#### Step 1: Create Campaign and Variation Custom Properties

Before configuring the Experiment Settings, you must first parse the campaign and variation names from the `"AB Tasty"` property into their own dedicated custom properties.

Navigate to **Lexicon** in your Mixpanel project and create the two custom properties below.&#x20;

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FXfb8nQujDI7CozdCB4sj%2Fadd85567-80d5-4a11-b05c-0934a5365b28.png?alt=media&#x26;token=20722ff2-7838-40d6-9f2c-5c32565232aa" alt="" width="375"><figcaption></figcaption></figure>

This property uses a REGEX function to extract the campaign name.

**A.Create a new Custom Property.**

1. Name it. `AB Tasty Campaign Name` is recommended, but the name does not need to exactly match this format.
2. Use the following formula:

   **How it works:** This formula reads the `"AB Tasty"` property and extracts only the text that exists *between* the first and second ID brackets (e.g., `[12345]` and `[67890]`).<br>

   1. Use the following formula:

      <pre data-full-width="true"><code>REGEX_EXTRACT(properties["AB Tasty"], "^\\[\\d+\\](.*?)(?=\\[\\d+\\])", 1)
      </code></pre>

   2. **Save** the property.

   > **How it works:** This formula reads the `"AB Tasty"` property and extracts only the text that exists *between* the first and second ID brackets (e.g., `[12345]` and `[67890]`).

**B.** **Variation Custom Property**

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2F6z29CtQ59DDtHq05ksA2%2Ffd48158a-a436-48bc-9d2b-f4cb9931f2e6.png?alt=media&#x26;token=b7477569-3fbe-454d-8c59-90a8b1afd023" alt="" width="375"><figcaption></figcaption></figure>

This property uses a nested SPLIT function to isolate the variation name.

1. **Create another new Custom Property.**
2. Name it. `AB Tasty Variant Name` is recommended, but the name does not need to exactly match this format.
3. Use the following formula:

   ```
   SPLIT(SPLIT(properties["AB Tasty"], "[", 3), "]", 1)
   ```
4. **Save** the property.

> **How it works:** This formula first splits the full string by the `[` character to isolate the end of the string, and then splits that result by the `]` character to capture only the variation name.

#### Step 2: Configure Project Experiment Settings

With your Custom Properties created, you can now tell Mixpanel how to recognize your AB Tasty experiments.

<figure><img src="https://github.com/user-attachments/assets/4384ed79-79d8-4035-8ffe-35550a0835e1" alt="" width="375"><figcaption></figcaption></figure>

1. Navigate to your **Project Settings**.
2. Scroll to the **Experiment Event Settings** section.
3. Define the mapping for your AB Tasty experiments:
   * **Experiment Event**: Select the `"Event"` event.
   * **Experiment Name**: Map this to your new custom property. `AB Tasty Campaign Name`.
   * **Variant Name**: Map this to your new custom property. `AB Tasty Variation Name`.
4. **Save** your settings.
   {% endstep %}
   {% endstepper %}

<figure><img src="https://support.abtasty.com/hc/article_attachments/7308545509788" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/integrations/push-integrations/mixpanel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
