Many Mixpanel customers successfully integrate using Segment. This integration collects your data within Segment and then passes that data along to Mixpanel, which means you'll primarily be using Segment's methods in your implementation rather than Mixpanel’s native libraries. Segment wraps Mixpanel’s libraries, so you can still access native Mixpanel functions if Segment methods don’t accomplish your goals.
The Segment-Mixpanel integration is handled primarily by Segment, but that being said, it’s a good idea to take a look at documentation on both sides to understand some of Mixpanel’s nuances and how to structure Segment data so that you have maximum flexibility when creating reports in Mixpanel.
What to Track
As with any Mixpanel integration, think carefully early on about what Events you'd like to track using Segment, and give those Events consistent and clear names.
Mixpanel allows you to send information along with Events, providing additional detail about the Event itself or the person performing that Event. These bits of information are called Properties. Mixpanel has three types of Properties: Event Properties, sent with a single Event; Super Properties, sent with every Event; and User Profile Properties, set on User Profiles. Learn more about Event Properties, Super Properties, and User Properties in Mixpanel.
If you’re using one of Segment’s client-side libraries, user specific details should be collected as Traits, which are the Segment equivalent of Mixpanel’s Super and User Properties combined. By default, each key-value pair in the Trait object will be registered as a Super Property in Mixpanel. And if you’ve enabled Mixpanel People in your Segment settings, these Traits will automatically be set as User properties as well.
Review the resources in Mixpanel's Getting Started Guide to get a sense of how Mixpanel structures its Event data so you can set up your Segment tracking with these concepts in mind.
Managing User Identity
It’s important to send data to Mixpanel with consistent unique identifiers that represent your individual users so that you can track them throughout their lifetime on any device. Note that Mixpanel's client-side libraries assign a unique identifier for users (called the distinct_id) automatically when they first engage with your app.
Debugging this setup can get complex when you are passing Events through a service like Segment first, so before implementation, review Mixpanel’s identity management documentation.
Once you understand how Mixpanel handles user identity, check out Segment’s documentation on using the alias function for a complete view of identity management on Mixpanel with a Segment integration.
During implementation, ensure Event tracking is functioning as expected with Segment by testing activity and monitoring the Events that come into the Live View tab in your Mixpanel project and Segment’s Live Debugger. The Mixpanel Live View report allows you to see Events arrive in your project in real time and examine the exact properties that are sent with them to ensure you implemented correctly.
Segment Integration Guide
For additional information on getting started, visit Segment’s Mixpanel documentation.