# 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="https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2FZrkhti9o9SydhYsFOWX8%2Fimage.png?alt=media&#x26;token=fbdd50ef-b764-413b-bc2f-d0ff2de284de" alt="" data-size="line"> icon in the top navigation bar and then select **Integrations**.

![](https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2FdYPMDbfh2lENgtlcaBh0%2Fimage.png?alt=media\&token=8d17f68c-9a71-436b-852d-af21d3d7aa04)

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="https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2FcyVW79QEBEv4GhJHt3eJ%2Fwebhook.png?alt=media&#x26;token=17be08ed-3a66-4df2-8ac6-b6dc11ace567" 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**.

![](https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2F5QQAMFoICTHJACvCv8OL%2Fimage.png?alt=media\&token=03498a77-69e3-4f98-8e91-0988df2a4e8a)

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.

![](https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2FxNPpjV9wjuVvi1DZYxkl%2Fimage.png?alt=media\&token=4830aa88-1c7f-4ce2-ba55-73dc76e7e41c)

&#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.
