# Mixpanel

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## How the Mixpanel integration works

The [Mixpanel](https://mixpanel.com/) integration has two functions.

- Incoming: Statsig can sync your Mixpanel user cohorts with a Statsig ID list segment.
- Outgoing: Statsig can forward Statsig events to Mixpanel.

## Cohort syncing

> **Note:**
>
> This integration supports ingestion only for Statsig Cloud. For Warehouse Native, create a metrics source that references this data in your warehouse.

Statsig can ingest user information through [Mixpanel Cohort Syncing](https://developer.mixpanel.com/docs/cohort-webhooks)

1. On Statsig, navigate to [Segments](https://console.statsig.com/segments) on the left navigation menu and create a segment.

- **Name**: Must match the name of your Mixpanel cohort.
- **Type of segment**: Should be ID List.

![statsig-segment-config](https://docs.statsig.com/images/integrations/data-connectors/mixpanel/id_list_segments.png)

2. On Mixpanel, click on the Data Management navbar item and choose Integrations from the dropdown.

![mixpanel-integration-menu](https://docs.statsig.com/images/integrations/data-connectors/mixpanel/195173611-170f02df-543f-4198-8589-7db313f4dd9f.png)

3. In the list of integrations, scroll until you find Custom Webhook and then select it.

![mixpanel-custom-webhook](https://docs.statsig.com/images/integrations/data-connectors/mixpanel/195173845-73ac1d5b-94b4-4daf-bf36-102eabd5d1fe.png)

4. In the dialog that appears, paste the url below, substituting the SERVER\_SECRET\_KEY with a "Server Secret Key" found in [Project Settings](https://console.statsig.com/api_keys), then click Continue.

```plaintext
https://api.statsig.com/v1/webhooks/mixpanel?statsig-api-key=SERVER_SECRET_KEY
```

![custom-webhook-dialog](https://docs.statsig.com/images/integrations/data-connectors/mixpanel/195174446-d3e8078c-ebaf-4ed4-bb5b-f8195694bade.png)

5. Click "Enable" (or "Confirm" if you're updating the integration).
6. You can now start a cohort sync job on Mixpanel from the Cohorts page.

## Configuring outbound events

To export your Statsig events to Mixpanel:

1. Get a copy of your "Project Token" from Mixpanel by following this [guide](https://help.mixpanel.com/hc/en-us/articles/115004502806-Find-Project-Token-).
2. Paste your project token into the Outgoing configuration on the Statsig integration panel.
3. Select your **Data Residency Region** based on your Mixpanel project's data residency configuration:

   - **US** (default): Statsig sends events to the global `api.mixpanel.com` endpoint
   - **EU**: For projects using [EU data residency](https://docs.mixpanel.com/docs/privacy/eu-residency)
   - **India**: For projects using [India data residency](https://docs.mixpanel.com/docs/privacy/in-residency)
4. Click "Enable" (or "Confirm" if you're updating the integration).

   ![mixpanel-outgoing-configuration](https://docs.statsig.com/images/integrations/data-connectors/mixpanel/mixpanel-outgoing-data-residency.png)
5. Verify Statsig is forwarding your events by visiting the Events tab on Mixpanel.

   ![mixpanel-event-tab](https://docs.statsig.com/images/integrations/data-connectors/mixpanel/195172678-8ff14bfe-6400-4660-b1dd-fef1780ddcd5.png)

### Filtering events

You can customize which events Statsig sends to Mixpanel using [Event Filtering](https://docs.statsig.com/integrations/event_filtering#outgoing-event-filtering).
