> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifly.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync Mixpanel cohorts

> Sync cohorts from Mixpanel to Notifly user groups and use those groups as campaign audiences.

> [!TIP]
>
> * Cohort sync requires a paid Mixpanel plan.
> * The Mixpanel integration is available on Notifly's Pro and Enterprise plans.

When you sync a Mixpanel cohort, it appears as a user group in Notifly that you can target in campaigns.

* Send a reminder with a discount to users who left items in their cart.
* Introduce a new feature through in-app popups and push notifications to users who haven't tried it.
* Send a series of personalized messages, such as offers or updates, to users who haven't opened the app in at least 30 days.

## Before you start

* Notifly matches each member's Mixpanel distinct ID (`mixpanel_distinct_id`) to a Notifly `external_user_id`.
* Before syncing a cohort, make sure the users you want to target already have matching IDs in Notifly.
* Mixpanel allows up to 60 recurring syncs across all destinations in a project.
* Notifly stores cohort membership as a user property.

> [!NOTE]
>
> If you are setting up a new webhook destination, ask Notifly support to verify the fields your Mixpanel project sends before starting the sync.

## 1. Get your Notifly credentials

1. In the Notifly console, open **Settings** > **Product & Project**.
2. Copy your **Project ID**.
3. Under **API Credentials**, copy your **Access Key**. Copy the **Secret Key** from the dialog that appears when you create or renew it. For an existing Secret Key, ask your development team.

> [!NOTE]
>
> Store the Secret Key only on the server. Notify your development team before renewing it.

## 2. Add a webhook in Mixpanel

For the latest screenshots, see [Mixpanel's guide to custom webhook destinations](https://docs.mixpanel.com/docs/cohort-sync/webhooks).

1. In Mixpanel, select **Data** > **Destinations**.

2. Click **Add Destination**, select **Webhook**, and click **Connect**.

3. Enter the connection name and webhook URL. Enable **Basic Authentication**, then enter your Access Key as the username and your Secret Key as the password.

| Field | Value | Details |
| - | - | - |
| Connection name | A name you can recognize | Example: Notifly cohort sync |
| URL | `https://integration.notifly.tech/mixpanel/projects/<project_id>/cohorts` | Find your project ID in **Settings** in the Notifly console. |
| Username | `<access_key>` | Find the access key in **Settings** > **Product & Project** > **API Credentials** in the Notifly console. |
| Password | `<secret_key>` | Ask your development team for the secret key. |

> [!NOTE]
>
> Your project ID and access key are available in **Settings** in the Notifly console.
>
> Copy the Secret Key before closing the dialog that appears when you create or renew it. To get an existing key, ask your development team.

## 3. Send the cohort

1. In Mixpanel, open **Lexicon** > **Cohorts**.
2. Open the three-dot menu next to the cohort and select **Export to…** > **Webhook**.
3. Select the custom webhook you created for Notifly.
4. Choose a one-time export or a recurring sync. If Mixpanel displays **Properties to Export**, select the fields you confirmed with Notifly support for this webhook destination. Additional properties do not change the ID Notifly uses to match users.
5. Click **Start Sync**.

> [!NOTE]
>
> The first recurring sync sends the full cohort. Later syncs send only users added or removed.

> [!WARNING]
>
> If you reach the project's recurring sync limit, remove a sync you no longer use before adding another.

## 4. Verify the cohort in Notifly

After you send the cohort, open **User Management > User Group** in the Notifly console. Look for the cohort name followed by `(Mixpanel)`.

![Mixpanel cohort in the Notifly user group list](https://mintcdn.com/notifly/0_mniRtlC78csfem/images/i18n/en/mixpanel/mixpanel-integration-usage.png?fit=max\&auto=format\&n=0_mniRtlC78csfem\&q=85\&s=6dc8d718c6fff6f4fe9335c11a34470c)

In the campaign's audience settings, click **Import User Group** and select the synced cohort. You can add more conditions as needed.

> [!NOTE]
>
> Notifly adds only users it can identify.
>
> For example, Cohort 1 contains users A, B, and C. If only A and C have matching `external_user_id` values in Notifly, the new user group contains only A and C.

## FAQ

> [accordion] Can I use cohort sync and event export together?
>
> Yes. You can set up and use both features independently.

> [accordion] Why does my user count differ from the count in Mixpanel?
>
> Notifly adds only users whose Mixpanel distinct ID matches an `external_user_id` in Notifly. Check that the Mixpanel distinct ID is the same as the user ID you send to Notifly.

> [accordion] Which sync type should I choose?
>
> * Use **Recurring sync** to keep the audience up to date, such as for cart abandonment reminders.
> * Use **One-time sync** to use the cohort as it was at export time, such as for a campaign based on a monthly report.

> [accordion] Can I sync multiple cohorts?
>
> Yes. Each Mixpanel cohort appears as a separate Notifly user group.

> [accordion] Can I edit a synced user group manually?
>
> You can't edit a synced user group directly in Notifly. Edit the cohort in Mixpanel and sync it again.

> [accordion] Is there a limit on recurring syncs?
>
> Mixpanel allows up to 60 recurring syncs per project across all destinations. Remove any syncs you no longer use.

> [accordion] Why can't I find my synced cohort in Notifly?
>
> The first sync can take 20 to 30 minutes. If the cohort still does not appear after 30 minutes, contact Notifly in your dedicated Slack channel or email [contact@notifly.tech](mailto:contact@notifly.tech).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.