> For the complete documentation index, see [llms.txt](https://documentation.blitzllama.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.blitzllama.com/connections-sources/mixpanel.md).

# Mixpanel

Seamlessly export user cohorts from Mixpanel to Blitzllama for better-targeted micro surveys.  We do this using Mixpanel's Cohort Sync feature, which enables one-click cohort exports to Blitzllama.&#x20;

### Supported Capabilities

Mixpanel integration enables the following capabilities:

* Import Mixpanel cohorts via one-time export and dynamic sync
* These cohorts can be used in Blitzllama for launching micro surveys to the right users

### Setting up the Mixpanel integration

A common identifier `blitzllama_user_id` is used to match users between Mixpanel and Blitzllama. You will need to ensure that `blitzllama_user_id` user property is declared on Mixpanel user profiles so they can be joined with Blitzllama's user data.

This can be achieved by declaring the `blitzllama_user_id` in the Mixpanel tracking code:

{% tabs %}
{% tab title="Android" %}

```kotlin
//Sets user attribute "blitzllama_user_id" to "123"
mixpanel.people.set("blitzllama_user_id", "123" );
```

{% endtab %}

{% tab title="iOS" %}

```swift
Mixpanel.mainInstance().people.set(properties: [ "blitzllama_user_id":"Premium"])
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
//Sets user attribute "blitzllama_user_id" to "123"
mixpanel.people.set("blitzllama_user_id", "123" );
```

{% endtab %}
{% endtabs %}

### Enable Blitzllama integration on Mixpanel's dashboard

1. Click the <img src="/files/lGM28epZVBD03K9vdtIS" alt="" data-size="line"> icon in the top navigation bar and then select **Integrations**.

![](/files/iZHwcqkKxTfaervMxELk)

2\. Scroll down on the **Integrations** page, find **Custom Webhook,** and click **Connect**.&#x20;

{% hint style="danger" %}
Only the Mixpanel project owners and admins will be able to make the connection.
{% endhint %}

3\. Go to the Connections tab on Blitzllama's dashboard, search for Mixpanel, and click connect to get the **URL** and **API KEY**. Under **PROPERTIES TO EXPORT** ensure to add `blitzllama_user_id` from the list of properties.

&#x20;<img src="/files/1VBJm86VPZa5KQGHNziR" alt="" data-size="original">&#x20;

### Export Mixpanel Cohorts to Blitzllama

To export a Mixpanel cohort to Blitzllama:

1\. Click **Data Management** at the top of Mixpanel. Navigate to **Cohorts**.

2\. Select the cohort to send to Blitzllama. Select **Export to Blitzllama**.

![](/files/ncRGwVNLyVLVnkZ0R8ee)

3\. Select one of the following sync types and then click Start Sync:&#x20;

**One-time Sync:** In the case of one-time sync, Mixpanel sends a one-time list of users who are currently part of the cohort to Blitzllama.&#x20;

**Dynamic Sync:** In the case of dynamic sync, Mixpanel initiates sync between a cohort and Blitzllama every 30 minutes. The imported segment is updated every 30 minutes to reflect the most recent list of users in the segment.&#x20;

The cohort name defined in the Mixpanel dashboard appears as a cohort under the Cohorts list page of the Blitzllama dashboard.<br>

### Access the Imported Cohort in Blitzllama

In order to access the imported cohorts in Blitzllama:

1. Navigate **Cohorts** tab, all the Mixpanel imported cohorts will have the source as Mixpanel.

![](/files/eY1RWW0a6JqyAVEJvSbJ)

&#x20;2\. Mixpanel's cohorts can be used just like cohorts with the exception that these cohorts cannot be filtered further.

{% hint style="info" %}
Mixpanel exports only identified users to other partners, such as Blitzllama. When receiving cohorts from Mixpanel, the user identity is matched in the following manner:

If the `blitzllama_user_id` is present, it is matched with the identity value of the user present in Blitzllama. If a match is found, the profile becomes part of the cohort. If `blitzllama_user_id` is not present or does not match with a user profile in Blitzllama, the user profile is not created in the cohort.&#x20;
{% endhint %}

In case you are stuck at any of the above steps, please don't hesitate to email us at <tech@blitzllama.com> or hit us up on the support chat.
