# Forward events to Mixpanel
> Send Snowplow events to Mixpanel for product analytics and user behavior insights using the Import API with support for event tracking and custom properties.
> Source: https://docs.snowplow.io/docs/destinations/forwarding-events/integrations/mixpanel/
> Documentation index: https://docs.snowplow.io/llms.txt

[Snowplow supported](/docs/destinations/#destinations-catalog "Built and supported by Snowplow") · Paid add-on · Event forwarder · Real time · AWS, Azure, GCP

Send Snowplow events to Mixpanel to power product analytics, user behavior tracking, and funnel analysis using Mixpanel's [Import API](https://developer.mixpanel.com/reference/import-events).

## Prerequisites

Before setting up the forwarder in Console, you'll need the following from your Mixpanel account:

- **Project ID**: found in Mixpanel under **Settings** > **Project Settings**
- **Service Account Username**: create a service account in Mixpanel under **Settings** > **Organization Settings** > **Service Accounts**. The service account must have either **Admin** or **Owner** permissions.
- **Service Account Password**: generated when you create the service account

> **Tip: Test in a non-production project first**
>
> To avoid introducing test data in your production Mixpanel project, we recommend using a test or development Mixpanel project to test your transformations first. Then, create a new Connection in Console with your production credentials, and a new forwarder that imports the configuration from your development forwarder.

## Getting started

### Configure the destination

To create the connection and forwarder, follow the steps in [Creating forwarders](/docs/destinations/forwarding-events/creating-forwarders/).

When configuring the connection, select **Mixpanel** for the connection type, enter your project ID, service account username, and service account password. You'll also need to select the **Server Location** where your Mixpanel project is hosted:

- **United States**: `https://api.mixpanel.com/`
- **European Union**: `https://api-eu.mixpanel.com/`
- **India**: `https://api-in.mixpanel.com/`

### Validate the integration

You can confirm events are reaching Mixpanel by checking the **Events** page in your Mixpanel account:

1. From the left navigation bar, click **Events**
2. You should see your Snowplow events appearing in the live view
3. You can also navigate to **Settings** > **Project Settings** > **Data & Exports** to view import statistics

## Identity management

Mixpanel uses a combination of `distinct_id` (user identifier) and `$device_id` (device identifier) to track users across sessions. The Snowplow integration defaults to using `user_id` for `distinct_id` and a coalesce of `domain_userid` and `client_sesion.user_id` for `$device_id`, which supports Mixpanel's [Simplified ID Merge system](https://docs.mixpanel.com/docs/tracking-methods/id-management#simplified-id-merge-system).

When a user logs in and your event contains a `user_id` value, Mixpanel will automatically merge the user's anonymous activity (tracked via `$device_id`) with their identified profile (tracked via `distinct_id`).

## Sending custom properties

You can send custom event properties beyond the standard fields defined in the schema reference below. Custom properties are nested under the `properties` object. When configuring your forwarder, add field mappings formatted as `properties.your_custom_field` (e.g., `properties.plan_type`, `properties.feature_flag`).

For property names containing spaces, use bracket notation (e.g., `properties["referred by"]`).

See Mixpanel's [Import Events API documentation](https://developer.mixpanel.com/reference/import-events) for details on supported data types and property requirements. See [Creating forwarders](/docs/destinations/forwarding-events/creating-forwarders/) for details on configuring field mappings.

## Schema reference

This section contains information on the fields you can send to Mixpanel, including field names, data types, required fields, and default Snowplow mapping expressions.

| Field                 | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `event` _string_      | _Required._ The name of the eventDefault mapping: `event.event_name`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `properties` _object_ | _Required._Properties:* `time` (integer, required): The time at which the event occurred, in milliseconds since epoch. Default mapping: `spTstampToEpochMillis(event.derived_tstamp)`
* `distinct_id` (string, required): Identifies the user who performed the event. Default mapping: `event.user_id`
* `$insert_id` (string, required): A unique identifier for the event, used for deduplication. Default mapping: `event.event_id`
* `ip` (string, optional): The IP address of the user. Default mapping: `event.user_ipaddress`
* `$city` (string, optional): The city of the event sender. Default mapping: `event.geo_city`
* `$region` (string, optional): The region (state or province) of the event sender. Default mapping: `event.geo_region`
* `mp_country_code` (string, optional): The country of the event sender. Default mapping: `event.geo_country`
* `$browser` (string, optional): Name of the browser. Default mapping: `event.contexts_nl_basjes_yauaa_context_1?.[0]?.agentName`
* `$browser_version` (string, optional): Version of the browser. Default mapping: `event.contexts_nl_basjes_yauaa_context_1?.[0]?.agentVersion`
* `$current_url` (string, optional): The full URL of the webpage on which the event is triggered. Default mapping: `event.page_url`
* `$referrer` (string, optional): Referring URL including your own domain. Default mapping: `event.page_referrer`
* `$referring_domain` (string, optional): Referring domain including your own domain. Default mapping: `event.refr_urlhost`
* `$device` (string, optional): Name of the device. Default mapping: `event.contexts_nl_basjes_yauaa_context_1?.[0]?.deviceName`
* `$device_id` (string, optional): A unique device identifier. Used in Mixpanel's Simplified ID Merge API. Default mapping: `event.domain_userid ?? event.contexts_com_snowplowanalytics_snowplow_client_session_1?.[0]?.userId`
* `$screen_height` (integer, optional): The height of the device screen in pixels. Default mapping: `event.dvce_screenheight`
* `$screen_width` (integer, optional): The width of the device screen in pixels. Default mapping: `event.dvce_screenwidth`
* `$os` (string, optional): Operating system of the device. Default mapping: `event.os_name`
* `$os_version` (string, optional): Operating system version. Default mapping: `event.contexts_nl_basjes_yauaa_context_1?.[0]?.operatingSystemVersion`
* `$manufacturer` (string, optional): Manufacturer of the device. Default mapping: `event.contexts_nl_basjes_yauaa_context_1?.[0]?.deviceBrand`
* `$model` (string, optional): Model of the device. Default mapping: `event.contexts_nl_basjes_yauaa_context_1?.[0]?.deviceName`
* `$app_version_string` (string, optional): The app version. Default mapping: `event.contexts_com_snowplowanalytics_mobile_application_1?.[0]?.version`
* `$app_build_number` (string, optional): Build number for the mobile app. Default mapping: `event.contexts_com_snowplowanalytics_mobile_application_1?.[0]?.build`
* `$carrier` (string, optional): Wireless carrier of the device owner. Default mapping: `event.contexts_nl_basjes_yauaa_context_1?.[0]?.carrier`
* `$radio` (string, optional): The current cellular network communication standard (3G, 4G, LTE, etc). Default mapping: `event.contexts_com_snowplowanalytics_snowplow_mobile_context_1?.[0]?.networkTechnology`
* `$wifi` (boolean, optional): Set to true if the user's device is connected to wifi. Default mapping: `event.contexts_com_snowplowanalytics_snowplow_mobile_context_1?.[0]?.networkType === 'wifi'`
* `$user_id` (string, optional): The identified ID of the user. Used in Mixpanel's Simplified ID Merge API. Default mapping: `event.user_id`
* `$lib_version` (string, optional): Tracker library version. Default mapping: `event.v_tracker`
* `utm_source` (string, optional): UTM source parameter from the URL. Default mapping: `event.mkt_source`
* `utm_medium` (string, optional): UTM medium parameter from the URL. Default mapping: `event.mkt_medium`
* `utm_campaign` (string, optional): UTM campaign parameter from the URL. Default mapping: `event.mkt_campaign`
* `utm_content` (string, optional): UTM content parameter from the URL. Default mapping: `event.mkt_content`
* `utm_term` (string, optional): UTM term parameter from the URL. Default mapping: `event.mkt_term`
* `mp_lib` (string, optional): Tracker library that sent the event. Default mapping: `'Snowplow: ' + event.v_tracker`
* `mp_sent_by_lib_version` (string, optional): Mixpanel library version used to send data (not necessarily the same as the version which enqueued the data).
* `$screen_dpi` (integer, optional): Pixel density of the device screen.
* `$initial_referrer` (string, optional): Referring URL when the user first arrived on your site. Defaults to “$direct” if the user is not referred.
* `$initial_referring_domain` (string, optional): Referring domain at first arrival. Defaults to “$direct” if the user is not referred.
* `$search_engine` (string, optional): The search engine that the customer used when they arrived at your domain.
* `mp_keyword` (string, optional): Search keywords detected on the referrer from a search engine to your domain. This property is only collected when search keywords are included in a URL.
* `$watch_model` (string, optional): The model of the iOS watch.
* `$bluetooth_enabled` (boolean, optional): Set to true if Bluetooth is enabled, false if not.
* `$bluetooth_version` (string, optional): Set to “none”, “ble”, or “classic”.
* `$has_nfc` (boolean, optional): The device supports Near Field Communication(NFC). Set to true if the device hardware supports NFC, false if not.
* `$has_telephone` (boolean, optional): Set to true if this device has telephone functionality, false if not. |
