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

# Mixpanel

> Perform deeper analysis and better understand user behavior by bringing enriched customer data from your data warehouse into Mixpanel

## Overview

Ideally, your data warehouse is the single source of truth for all your customer data.
When that's the case, using your warehouse as the source for your Mixpanel data enables richer product-usage analysis.
You can sync enriched data from your warehouse to create more granular segments on Mixpanel as well as bring in data from your engagement tools.
Moreover, you can ensure that your product and growth teams work with data that's always up-to-date and in the expected format.
Lastly, if your company also uses a Business Intelligence tool such as Looker or Mode, you can ensure that the data is consistent across both systems.

## Supported syncing

| Sync Type | Description | Supported Sync Modes |
| - | - | - |
| **Objects** | Sync records to objects such as users or organizations (groups) in your destination. | Upsert |
| **Events** | Sync records as events to your destination. This is often in the form of a track call. | Insert |
| **Lookup tables** | Sync records as a CSV file to enrich event and profile properties within Mixpanel. | All |

* In **Upsert** mode, new users and groups are inserted into Mixpanel and all attributes are kept up-to-date.
* In **Insert** mode, new events are inserted as track calls.
* In **All** sync mode, the entire lookup table is replaced with each sync.

For more information about sync modes, refer to the [sync modes](https://docs.hightouch.com/syncs/types-and-modes.md#sync-modes) docs.

## Connect to Mixpanel

To configure your Mixpanel destination you need to provide the following information:

* Project ID
* Project Token
* Service Account Username and Secret
* Region, which must match your Mixpanel project's data residency
* Group Keys, when syncing group objects

### Project ID

To find your Project ID, click the Settings icon, then Project Settings.
Then navigate to Overview > Project Details.

![Mixpanel Project ID](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-project-id.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=6b48bf43003b971637f9da8539d02c1f)

### Project token

To find your Project Token, click the Settings icon, then Project Settings.
Then navigate to Overview > Access Keys.

![Mixpanel Project Token](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-project-token.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=e2fa86a8748be2b19e93d22dde21f38e)

### Service account

To receive your Service Account Username and Secret you must first create a Service Account.\
Click the Settings icon, then Project Settings.
Then navigate to Service Accounts > Add Service Account and copy the **Username** and **Secret**.

![Mixpanel Service Account](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-service-account.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=481a730dfef638c2b7ba6e814caa1c3d)

> [!NOTE]
>
> Be sure to give your Service Account **Owner** or **Admin** permissions.

### Group keys

If you are syncing group profiles or assigning users to groups, you need to indicate which Group Key to use.
To find your Group Keys, click the Settings icon, then Project Settings.
Then navigate to Overview > Group Keys. Copy the appropriate **Key** value.

![Example Group Keys in the Mixpanel UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-group-keys.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=1dfc9fd61303a67d28818ef8ac7c669f)

## Syncing data

### Objects

You can decide to sync either User Objects or Group Objects.

![Selecting the User object in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-user-group.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=87b2ec13c608fc850d808449afc324a8)

When syncing Group Objects, enter the [appropriate group key](#group-keys) into the **Mixpanel group key** field.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-org-id.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=f5177b2c3cf5a0b5d5fb3086e25f4696)

#### Record matching

You can match records from your source to your Mixpanel workspace by Mixpanel User ID, email or Group ID.

![Matching records on the Mixpanel UserID in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-record-matching.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=00ed5f124ec99503b6f83958e4f7926a)

#### Field mapping

You can sync columns from your source to your default and custom fields in Mixpanel.
If you're syncing User Objects, you can see two sections: one for native Mixpanel fields and one for custom fields.

![Field mapping in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-field-mapping-objects-1.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=ff1facb4a2762c525c96e6529353801e)

If you're syncing Group Objects, you can only see one section.

![Field mapping in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-field-mapping-objects-2.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=7db12625aded7b178cdc71982e2c4a0a)

#### Users location

By default, users uploaded using Hightouch won't have any associated location in Mixpanel.
To set a location, provide an IP address (field `$ip`), or longitude and latitude coordinates (fields `$longitude` and `$latitude`).
For more information, you can visit [Mixpanel's official documentation](https://help.mixpanel.com/hc/en-us/articles/115004499343-Tracking-Geolocation-with-Server-Side-Implementation).

#### Assigning users to groups

To assign users to groups, create a sync for User Objects.
Then, create a column in your model which contains the group IDs that you want to assign the user to.
For example, to sync organizations, use a column called `organizations` containing either a group ID (`google`) or an array of group IDs (`[google, apple, microsoft]`).
Then, [find your group key](#group-keys), and use it as the destination field to sync to.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-user-to-groups.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=63d92ea8e8a1e5f5ad42ee45b917ce12)

### Events

Hightouch supports sending events of a given name, for example, `Signed Up`.

> [!WARNING]
>
> To ensure syncs send each event, your event model must use a truly unique [primary key](https://docs.hightouch.com/getting-started/concepts.md#unique-primary-key-requirement). See the [events syncs](https://docs.hightouch.com/syncs/types-and-modes.md#event-syncs) documentation for more information.

Hightouch lets you choose the column containing the event timestamp.

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-track-event.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=b1e49e6e9689ab7256571d20bb54f045)

> [!NOTE]
>
> Hightouch accepts various date time formats for the timestamp and automatically converts them to the format required by Mixpanel.

#### Record matching

You can match records from your source to your Mixpanel workspace by Mixpanel User ID.

![Matching events records in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-record-matching-events.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=ad8fa310c11ec27ef2d6ad482bc9a490)

#### Field mapping

Hightouch allows you to pass data to the event properties of a Mixpanel event.

![Mapping fields in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-field-mappings-events.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=ccd351f868a40b58e8c19fa97eab36f4)

#### Assigning events to groups

To assign events to groups, create a sync to events.
Then, create a column in your model which contains the group IDs that you want to assign the event to.
\
For example, to sync organizations, use a column called `organizations` containing either a group ID (`google`) or an array of group IDs (`[google, apple, microsoft]`).
Then, [find your group key](#group-keys), and use it as the destination field to sync to.

![Assigning events to a group using group key in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-events-groups.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=0ee85a86cb84764df9bd9bdc3d487c7f)

### Lookup tables

To sync data to your Lookup tables, choose **Enrichment**.
Then choose the specific Lookup table you want to replace.

![Syncing to Look up tables in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-lookup-tables-sync-configuration.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=ab281817e05e5180b230197c7a64730c)

#### Record matching

You can match records from your source to your Mixpanel workspace by the ID mapping of your choice.
The ID mapping should reference the unique identifier field of the events or profiles you are seeking to enrich.

![Matching records on the "ID" field in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-lookup-tables-record-matching.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=89a14f608a4be432cea8fe8ff6fe7830)

#### Field mapping

You may also sync columns from your source to your Mixpanel Lookup table's custom fields.

![Field mapping to custom fields in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-field-mappings-lookup-tables.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=33938646b44cdfbc3da457a1cfba86bf)

#### Creating lookup tables in Mixpanel

To create Lookup tables, you can import them directly in Mixpanel.
You can do this by clicking on the Data Management icon and then on Lexicon.
Navigate to Lookup Tables > Import > Lookup Table.

![Creating lookup tables in the Mixpanel UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-mixpanel-create-lookup-table.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=65fdd5fa103ee502a48423491d37bd09)

#### Limitations

Mixpanel's Lookup table endpoint comes with the following limits:

* Only 100 requests are allowed in a rolling 24 hour period. Please be mindful of this when choosing your sync schedule. Mixpanel recommends updating Lookup tables at most hourly.
* A Lookup table must not exceed 100 MB uncompressed (roughly 1-2M rows).

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).

## Common errors

### Sync succeeds but data doesn't appear in Mixpanel

If your sync succeeds in Hightouch but the data doesn't appear in Mixpanel, check the following:

* **Project token:** The [project token](#project-token) in your Hightouch destination must match the token of the Mixpanel project you're checking.
* **Region:** The **Region** you selected in your Hightouch destination (**Standard** or **Europe**) must match your Mixpanel project's data residency. To find it in Mixpanel, click the Settings icon, then go to **Project Settings** > **Overview** and check the **Data Residency** field.

### Changing projects

If you need to change your Project ID, you also need to update the API Key that you originally provided.
Project ID and API keys are paired together in the Mixpanel platform.
