LogoLogo
  • Contributing to RudderStack
  • Destination_Name
  • LICENSE
  • RudderStack Docs
  • docs
    • FAQ
    • Identity Resolution
    • Home
    • cloud-extract-sources
      • ActiveCampaign Source
      • Bing Ads
      • Chargebee
      • Common Settings
      • Facebook Ads
      • Freshdesk
      • Google Ads Source
      • Google Analytics
      • Google Search Console
      • Google Sheets
      • Cloud Extract Sources
      • Intercom v2
      • Intercom
      • Mailchimp
      • Marketo
      • Mixpanel
      • NetSuite
      • Pipedrive
      • QuickBooks
      • Salesforce Pardot
      • Sendgrid Source
      • Stripe Source
      • Xero
      • Zendesk Chat
      • Zendesk
      • hubspot
        • HubSpot Data Model and Schema Information
        • HubSpot
      • salesforce
        • Salesforce
        • Schema Comparison: RudderStack vs. Segment
    • connections
      • Connection Modes: Cloud Mode vs. Device Mode
    • data-governance
      • Data Governance
      • RudderTyper
      • Data Governance API
      • RudderTyper
      • tracking-plans
        • Tracking Plans
        • Tracking Plan Spreadsheet
    • data-warehouse-integrations
      • Amazon Redshift
      • Azure Data Lake
      • Azure Synapse
      • ClickHouse
      • Databricks Delta Lake
      • Google Cloud Storage Data Lake
      • Google BigQuery
      • Identity Resolution
      • Warehouse Destinations
      • Microsoft SQL Server
      • PostgreSQL
      • Amazon S3 Data Lake
      • Snowflake
      • FAQ
      • Warehouse Schema
    • destinations
      • Destinations
      • Webhooks
      • advertising
        • Bing Ads
        • Criteo
        • DCM Floodlight
        • Facebook App Events
        • Facebook Custom Audience
        • Facebook Pixel
        • Google Ads (gtag.js)
        • Google AdWords Enhanced Conversions
        • Google Adwords Remarketing Lists (Customer Match)
        • Advertising
        • LinkedIn Insight Tag
        • Lotame
        • Pinterest Tag
        • Reddit Pixel
        • Snap Pixel
        • TikTok Ads
      • analytics
        • Amplitude
        • AWS Personalize
        • Chartbeat
        • Firebase
        • FullStory
        • Google Analytics 360
        • Google Analytics
        • Heap.io
        • Hotjar
        • Analytics
        • Indicative
        • Keen
        • Kissmetrics
        • Kubit
        • Lytics
        • Mixpanel
        • Pendo
        • PostHog
        • Quantum Metric
        • Singular
        • adobe-analytics
          • Adobe Analytics Heartbeat Measurement
          • Mobile Device Mode Settings
          • Web Device Mode Settings
          • E-commerce Events
          • Adobe Analytics
          • Setting Up Adobe Analytics in RudderStack
        • google-analytics-4
          • Cloud Mode
          • Device Mode
          • Google Analytics 4
          • Setting up Google Analytics 4
        • profitwell
          • ProfitWell
          • Cloud Mode
          • Device Mode
      • attribution
        • Adjust
        • AppsFlyer
        • Branch
        • Attribution
        • Kochava
        • TVSquared
      • business-messaging
        • Business Messaging
        • Intercom
        • Kustomer
        • Slack
        • Trengo
      • continuous-integration
        • Visual Studio App Center
        • Continuous Integration
      • crm
        • Delighted
        • HubSpot
        • CRM
        • Salesforce
        • Variance
        • Zendesk
      • customer-data-platform
        • Customer Data Platform
        • Segment
      • error-reporting
        • Bugsnag
        • Error Reporting
        • Sentry
      • marketing
        • ActiveCampaign
        • AdRoll
        • Airship
        • Appcues
        • Autopilot
        • Blueshift
        • Braze
        • CleverTap
        • Customer.io
        • Gainsight PX
        • Gainsight
        • Marketing
        • Iterable
        • Klaviyo
        • Leanplum
        • Mailchimp
        • Marketo Lead Import
        • Marketo
        • MoEngage
        • Ometria
        • Pardot
        • Post Affiliate Pro
        • Qualtrics
        • SendGrid
        • Salesforce Marketing Cloud
        • Userlist
        • drip
          • Cloud Mode
          • Device Mode
          • Drip
          • Setting Up Drip in RudderStack
      • productivity
        • Google Sheets
        • Productivity
      • storage-platforms
        • Amazon S3
        • DigitalOcean Spaces
        • Google Cloud Storage
        • Storage Platforms
        • Azure Blob Storage
        • MinIO
        • Redis
      • streaming-platforms
        • Amazon EventBridge
        • Amazon Kinesis Firehose
        • Amazon Kinesis
        • Azure Event Hubs
        • BigQuery Stream
        • Confluent Cloud
        • Google Pub/Sub
        • Streaming Platforms
        • Apache Kafka
      • tag-managers
        • Google Tag Manager
        • Tag Managers
      • testing-and-personalization
        • Algolia Insights
        • Candu
        • Google Optimize
        • A/B Testing & Personalization
        • LaunchDarkly
        • Monetate
        • Optimizely Full Stack
        • Optimizely Web
        • Split.io
        • Statsig
        • VWO (Visual Website Optimizer)
    • get-started
      • RudderStack Cloud vs. RudderStack Open Source
      • Glossary
      • Get Started
      • RudderStack Architecture
    • reverse-etl
      • Amazon Redshift
      • Amazon S3
      • ClickHouse
      • FAQ
      • Google BigQuery
      • Reverse ETL
      • PostgreSQL
      • Snowflake
      • common-settings
        • Importing Data using Models
        • Importing Data using Tables
        • Common Settings
        • Sync Modes
        • Sync Schedule
      • features
        • Airflow Provider
        • Features
        • Models
        • Visual Data Mapper
    • rudderstack-api
      • Data Regulation API
      • HTTP API
      • RudderStack API
      • Personal Access Tokens
      • Pixel API
      • Test API
      • api-specification
        • Application Lifecycle Events Specification
        • API Specification
        • Video Events Specification
        • rudderstack-ecommerce-events-specification
          • Browsing
          • Coupons
          • E-Commerce Events Specification
          • Ordering
          • Promotions
          • Reviewing
          • Sharing
          • Wishlist
        • rudderstack-spec
          • Alias
          • Common Fields
          • Group
          • Identify
          • RudderStack Event Specification
          • Page
          • Screen
          • Track
    • rudderstack-cloud
      • Audit Logs
      • Dashboard Overview
      • Destinations
      • RudderStack Cloud
      • Live Events
      • Connection Modes: Cloud Mode vs. Device Mode
      • Sources
      • Teammates (User Management)
      • connections
        • Adding a Destination
        • Connections
    • rudderstack-open-source
      • Control Plane Setup
      • RudderStack Open Source
      • installing-and-setting-up-rudderstack
        • Developer Machine Setup
        • Docker
        • Data Plane Setup
        • Kubernetes
        • Sending Test Events
    • stream-sources
      • App Center
      • AppsFlyer
      • Auth0
      • Braze
      • Customer.io
      • Extole
      • Event Stream Sources
      • Iterable
      • Looker
      • PostHog
      • Segment
      • Shopify
      • Webhook Source
      • rudderstack-sdk-integration-guides
        • Client-side Event Filtering
        • SDKs
        • AMP Analytics
        • Cordova
        • .NET
        • Go
        • Java
        • Node.js
        • PHP
        • Python
        • React Native
        • Ruby
        • Rust
        • Unity
        • SDK FAQs
        • rudderstack-android-sdk
          • Adding Application Class
          • Flushing Events Periodically
          • Android
        • rudderstack-flutter-sdk
          • Flutter SDK v1
          • Flutter v2
          • Flutter
        • rudderstack-ios-sdk
          • iOS
          • tvOS
          • watchOS
        • rudderstack-javascript-sdk
          • Data Storage in Cookies
          • Detecting Ad-blocked Pages
          • JavaScript
          • JavaScript SDK Enhancements
          • JavaScript SDK FAQs
          • Querystring API
          • Quick Start Guide
          • Version Migration Guide
          • consent-managers
            • Consent Managers
            • OneTrust
    • transformations
      • Access Token
      • FAQ
      • Transformations
      • Transformations API
    • user-guides
      • User Guides
      • administrators-guide
        • Troubleshooting Guide
        • Alerting Guide
        • Bucket Configuration Settings for Event Backups
        • Configuration Parameters
        • Event Replay
        • High Availability
        • Horizontal Scaling
        • Administrator's Guides
        • Infrastructure Provisioning
        • Monitoring and Metrics
        • Okta SSO Setup
        • OneLogin SSO Setup
        • RudderStack Grafana Dashboard
        • Software Releases
      • how-to-guides
        • How to Use Custom Domains
        • How to Develop Integrations for RudderStack
        • How to Configure a Destination via the Event Payload
        • How to Filter Events using Different Methods
        • How to Filter Selective Destinations
        • How to Submit a Pull Request for a New Integration
        • How-to Guides
        • How to Debug Live Destination Events
        • How to Use AWS Lambda Functions with RudderStack
        • create-a-new-destination-transformer-for-rudder
          • Best Practices for Coding Transformation Functions in JavaScript
          • How to Create a New Destination Transformation for RudderStack
        • implement-native-js-sdk-integration
          • How to Add a Device Mode SDK to RudderStack JavaScript SDK
          • How to Implement a Native JavaScript SDK Integration
        • rudderstack-jamstack-integration
          • How to Integrate RudderStack with Your JAMstack Site
          • How to Integrate Rudderstack with Your Angular App
          • How to Integrate Rudderstack with Your Astro Site
          • How to Integrate Rudderstack with Your Eleventy Site
          • How to Integrate Rudderstack with Your Ember.js App
          • How to Integrate Rudderstack with a Gatsby Website
          • How to Integrate Rudderstack with a Hugo Site
          • How to Integrate Rudderstack with Your Jekyll Site
          • How to Integrate Rudderstack with Your Next.js App
          • How to Integrate Rudderstack with Your Nuxt.js App
          • How to Integrate Rudderstack with Your Svelte App
          • How to Integrate Rudderstack with Your Vue App
      • migration-guides
        • Migrating from Blendo to RudderStack
        • Migrating Your Warehouse Destination from Segment to RudderStack
        • Migration Guides
        • Migrating from Segment to RudderStack
  • src
    • @rocketseat
      • gatsby-theme-docs
        • text
          • Home
Powered by GitBook
On this page
  • Getting started
  • Connection settings
  • Identify
  • Reserved Mixpanel properties
  • Mixpanel People
  • Page
  • Page web device mode settings
  • Track
  • Tracking revenue
  • Tracking charge
  • Alias
  • Group
  • Sending historic events
  • Mapping RudderStack properties to Mixpanel properties
  • Explicitly setting People Properties and Super Properties
  • Mixpanel special traits
  • Incrementing events in Mixpanel People
  • Incrementing properties in Mixpanel People
  • Cross subdomain cookies
  • FAQ
  • Can I pass null and empty values for the properties?
  • Contact us

Was this helpful?

  1. docs
  2. destinations
  3. analytics

Mixpanel

Step-by-step guide to set up Mixpanel as a destination in RudderStack.

PreviousLyticsNextPendo

Last updated 3 years ago

Was this helpful?

is an analytics platform that lets you track user actions with your application. It offers features like in-app A/B testing, user survey forms, and custom reports to measure customer retention. It also provides specific tools for targeted business communication and engagement with your customers.

RudderStack supports Mixpanel as a destination to which you can seamlessly send your event data.

Find the open-source transformer code for this destination in our .

Getting started

Before configuring your source and destination on the RudderStack, verify if the source platform is supported by Mixpanel by referring to the table below:

Connection Mode

Web

Mobile

Server

Device mode

Supported

-

-

Cloud mode

Supported

Supported

Supported

To know more about the difference between cloud mode and device mode in RudderStack, read the guide.

Once you have confirmed that the source supports sending events to Mixpanel, follow these steps:

  • From your , add the source. From the list of destinations, select Mixpanel.

  • Assign a name to your destination and click on Next. You should then see the following screen:

Connection settings

To successfully configure Mixpanel as a destination, you will need to configure the following settings:

  • API Token: Enter your Mixpanel API Token.

  • API Secret: Enter your Mixpanel API secret.

  • Data Residency: Select the relevant option among US and EU. RudderStack will send your event data to the Mixpanel server in that region.

The following settings are applicable if you are using this destination via the web device mode:

  • Source Name: If specified, RudderStack sends this source name to Mixpanel for every event/page/screen call.

  • Cross Subdomain Cookie: If enabled, this option lets the Mixpanel cookie to persist between different pages of your application.

  • Persistence Type: This option lets you choose the persistence type for your Mixpanel cookies.

  • Secure Cookie: Enabling this option will mark the Mixpanel cookie as secure, i.e., it will only transmit over HTTPS.

The following event mapping setting is applicable only if you are sending events to Mixpanel via the cloud mode:

  • Use New Mapping: This option is disabled by default and sends the first name and last name as:

    $firstName : "John"

    $lastName : "Keener"

    If this option is enabled, RudderStack maps these fields to Mixpanel in the following way :

    $first_name : "John"

    $last_name : "Keener"

Rudderstack lets you pass empty and null values for the properties sent to Mixpanel.

Identify

To identify a user in Mixpanel, you need to call RudderStack's identify method.

A sample identify call is as shown:

rudderanalytics.identify("12345", {
  firstname: "Alex",
  city: "New Orleans",
  country: "USA",
  phone: "8005550100",
  email: "alex@example.com"
})

When sending events via the cloud mode, you can prevent the $last_seen attribute getting updated with incorrect times by setting active to false in the context object, as shown in the following snippet:

rudderanalytics.identify("12345", {
  firstname: "Alex",
  city: "New Orleans",
  country: "USA"
}, {
  context: {
    active: false
  }
})

Setting active to false sets Mixpanel's $ignore_time attribute to true. This way, you can bypass the “Last Seen” date property.

Reserved Mixpanel properties

Mixpanel has some reserved properties:

  • $first_name

  • $last_name

  • $name

  • $username

  • $created

  • $email

  • $phone

  • $avatar

  • $city

  • $country_code

  • $region

  • $unsubscribed

You should not create custom properties that begin with a $ sign.

Mixpanel People

Rudderstack does not send data to Mixpanel People by default, as it usually requires you to upgrade your Mixpanel account. If you want to use this feature, you can enable the Use Mixpanel People option in the Rudderstack dashboard.

You can identify the user traits without the userId if you wish to add the people properties in Mixpanel before knowing the userId. To do so, refer to the following snippet:

rudderanalytics.identify({
  email: 'alex@example.com',
  name: 'Alex Keener'
})

Currently, RudderStack supports this feature only for the web device mode.

Page

RudderStack passes all the page properties that you provide via the page call to Mixpanel, along with the other default properties. RudderStack sets the event name as Page for a page call and Screen for a screen call.

A sample page call is shown below:

rudderanalytics.page();

Page web device mode settings

Rudderstack will send 1 event to Mixpanel per page call.

For device mode, RudderStack offers the following three options for page calls:

  • Track All Pages with a Consolidated Event Name: This setting is enabled by default. RudderStack sends all the page and screen calls with the name Loaded a Page with the corresponding properties of the call. This lets you leverage Mixpanel's reporting capabilities for page/screen analytics in the best possible way.

  • Track Categorized Pages to Mixpanel: RudderStack tracks the categorized pages to Mixpanel. If you enable this setting in the dashboard, RudderStack sends a Viewed [<category>] Page event to Mixpanel. If the page name is also present in the event, then RudderStack sends a Viewed [<category> <page_name>] Page event.

  • Track Named Pages to Mixpanel: RudderStack also tracks the named pages to Mixpanel. If you enable this setting in the dashboard, RudderStack will send a Viewed [page_name] Page event. Note that this option has the least precedence and comes to effect only if the above two options are disabled in the RudderStack dashboard.

RudderStack gives the highest precedence to the Track All Pages with a Consolidated Event Name option even if Track Categorized Pages to Mixpanel and Track Named Pages to Mixpanel are enabled in the dashboard.

RudderStack expects atleast one of the three options listed above to be enabled for sending the page events to Mixpanel using device mode.

Track

To track user events, use the track method with the event name and the associated properties.

A sample track call is as shown:

rudderanalytics.track("track event", {
    test_prop1: 50,
    test_prop2: "prop_value"
});

Tracking revenue

Mixpanel lets you track revenue events. If you send revenue as a property in your track event, RudderStack tracks it as a revenue event.

Revenue tracking is done with a distinct_id (userId that you provide in your identify call; if userId is not present then it will be associated with an anonymousId.)

A sample revenue track call is as shown:

rudderanalytics.track("Purchase", {
  revenue: 100,
  currency: "USD"
});

Tracking charge

If Use Mixpanel People setting is enabled in your RudderStack dashboard and you include revenue as an event property, RudderStack will track a charge for the current user.

Alias

The alias call lets you associate multiple identities of a known user.

A sample alias call is as shown:

analytics.alias('userId', `previousId`);

Group

The group call lets you link an identified user with a group, such as a company, organization, or an account. It also lets you record any custom traits associated with that group like the name of the company, the number of employees, etc.

RudderStack lets you record the custom traits associated with a user group and send this information to Mixpanel.

A sample group call is shown below:

rudderanalytics.group(
  "sample_group_id", {
    name: "Tech group",
    industry: "Technology",
    employees: 100,
  }
);

RudderStack sends the group calls to Mixpanel only if one or more group keys are specified during the destination configuration in RudderStack, as shown:

Sending historic events

Mixpanel supports importing historical event data. However, note that the event timestamp should be within the last 5 years. Mixpanel rejects any data older than this duration. To send historic events, provide the timestamp in the timestamp field of the message. RudderStack will then send the event with the same timestamp to Mixpanel.

Mapping RudderStack properties to Mixpanel properties

RudderStack maps the following properties to the Mixpanel properties before sending them over Mixpanel's HTTP API.

RudderStack maps these fields only in the identify requests.

RudderStack property
Mixpanel property

traits.createdAt

$created

traits.email

$email

traits.firstName

$firstName

traits.lastName

$lastName

traits.name

$name

traits.username

$username

traits.phone

$phone

traits.avator

$avator

context.ip

ip or $ip

context.campaign.name

campaign_id

context.page.url

$current_url

context.os.name

$os

context.page.referrer

$referrer

context.network.carrier

$carrier

address.city

$city

address.country

$country_code

address.region

$region

context.location.latitude

$latitude

context.location.longitude

$longitude

context.page.manufacturer

$manufacturer

context.device.model

$model

context.screen.width

$screen_width

context.screen.height

$screen_height

context.network.wifi

$wifi

context.location.geoSource

$geoSource

context.traits.unsubscribed

$unsubscribed

traits.unsubscribed

$unsubscribed

properties.unsubscribed

$unsubscribed

context.location.timezone

$timezone

Explicitly setting People Properties and Super Properties

You can set all of your traits as both Super Properties and People Properties (If you have Use Mixpanel People option enabled) by enabling the Automatically set all Traits as Super Properties and People Properties option in the Rudderstack dashboard.

You can also choose to filter your reports by both People Properties and Super Properties. This gives you better control over what traits you can set as a Super Property or People Property. To do this, disable the Automatically set all Traits as Super Properties and People Properties option in the dashboard and add the traits that you want to send to Mixpanel as Super Properties or People Properties in the Properties to send as Super Properties and Traits to set as People Properties fields respectively, as shown below:

This feature is available in the web device mode only.

Mixpanel special traits

The following table lists all the properties that RudderStack sends to Mixpanel as special traits:

RudderStack Properties
Mixpanel Properties

created

$created

email

$email

firstName

$first_name

lastName

$last_name

lastSeen

$last_seen

name

$name

username

$username

phone

$phone

city/address.city

$city

region/address.state

$region

country/address.country

$country_code

Incrementing events in Mixpanel People

To increment event counts in Mixpanel People, you can add the events in the Events to increment in People field.

This feature is available in the web device mode only.

For each event name added, RudderStack automatically calls Mixpanel and sets a user trait as Last + <event_name>. For example, if you add Logged In to the list of increment events, RudderStack will increment a user trait called Logged In and set a trait called Last Logged In with the current date and time.

Increment works for known users only. If you make a track call, you must identify your user first.

Incrementing properties in Mixpanel People

To increment properties in Mixpanel People, you can add them in the Properties to Increment in People field. RudderStack will call Mixpanel’s increment when you attach a number to the specified property. For example, 'items purchased': 5.

This feature is available in the web device mode only.

Cross subdomain cookies

  • Cross Subdomain Cookie: This option will let you persist the Mixpanel cookie between different pages of your application.

  • Persistence Type: This option lets you choose the persistence type for your Mixpanel cookies.

  • Secure Cookie: Enabling this option will mark the Mixpanel cookie as secure, i.e., it will only transmit over HTTPs.

FAQ

Can I pass null and empty values for the properties?

Yes, RudderStack supports passing empty/null values for the properties sent to Mixpanel.

Contact us

For more information on obtaining the Mixpanel API Token and Secret, refer to this page.

Use Mixpanel People: This option sends all your identify calls to Mixpanel People. For more information, refer to the section below.

Automatically set all Traits as Super Properties and People properties: Refer to the section below.

Events to increment in People: Refer to the section below for more information on this field.

Properties to increment in People: Refer to the section below for more information on this field.

Page Tracking Options: For device mode, RudderStack offers three options for the page calls. Refer to the section below for more information on these options.

Group Key Settings: RudderStack sends the group calls to Mixpanel only if one or more group keys are specified here. For more information, refer to the section below.

Client-side Events Filtering: Refer to the guide for more information on this feature.

Mixpanel needs an identifier to uniquely identify a user. If you pass userId and anonymousId along with the Mixpanel API Secret (in the dashboard settings), then RudderStack first makes an identify call to Mixpanel using the userId and the traits. RudderStack then passes the userId and anonymousId via Mixpanel's feature, so that the two identifiers are glued to a single user profile.

For more information on how the group call works in Mixpanel, refer to Mixpanel's .

You must create the group key(s) of the same name in your Mixpanel . To administer the group keys, navigate to your project settings and click on Add Group Key under Group Keys.

RudderStack will send all the Mixpanel as People Properties. Hence, you can only add the properties that are not in this list.

For queries on any of the sections covered in this guide, you can or start a conversation in our community.

Mixpanel Help Center
Mixpanel People
Explicitly setting People Properties and Super Properties
Page web device mode settings
Group
Client-side Events Filtering
Merge Identities
Group Analytics documentation
project settings
contact us
Slack
Incrementing events in Mixpanel People
Incrementing properties in Mixpanel People
special traits
Mixpanel
GitHub repo
RudderStack Connection Modes
RudderStack dashboard
Mixpanel group key settings