How to Connect Segment to Mixpanel (Without Breaking Identity)

“We already use Segment. Can we just switch Mixpanel on?”

Yes, and it really is that fast to get data flowing. But I’ve seen the same three problems on almost every Segment-to-Mixpanel setup I’ve audited: events arriving in Mixpanel with Segment’s naming conventions that don’t match anything else, users split across two identities because of how anonymous IDs were handled, and group analytics that silently didn’t work because the group key wasn’t on the events.

This guide walks through connecting Segment to Mixpanel with the Mixpanel (Actions) destination, how each Segment call maps to Mixpanel, and the setup details that keep identity and groups working.

How the integration works

Segment collects events from your app once and forwards them to destinations. Mixpanel is one of those destinations. With the Actions destination:

  • Segment track calls become Mixpanel events, sent through Mixpanel’s Import API.
  • Segment identify calls identify the user in Mixpanel and set profile properties.
  • Segment page calls become page view events.
  • Segment group calls create or update group profiles.

Mixpanel’s docs say Segment works with both its Simplified and Original ID Merge APIs, and that the Actions destination maps Segment’s userId to Mixpanel’s distinct_id.

Actions vs Classic destination

There are two Mixpanel destinations in Segment:

Mixpanel (Actions)Mixpanel (Classic / Legacy)
ModeCloud mode onlyDevice or cloud mode
MappingExplicit, configurable field mappingsFixed behavior with settings toggles
RecommendationMixpanel recommends this for new setupsConsidered legacy

Use Actions unless you have a specific reason not to. If you’re on Classic, plan a migration, and test it in a dev project first (post 34).

Step 1: Prepare Mixpanel

  1. Create or choose your Mixpanel project and copy the project token (and note the data residency).
  2. In project settings, check whether the project uses Simplified or Original ID Merge (post 2).
  3. If you use group analytics, create your group key first (for example company_id), since Mixpanel doesn’t backfill events sent before the key exists (post 8).

Step 2: Add the Mixpanel (Actions) destination in Segment

  1. In Segment, open your source and click Add Destination.
  2. Search for Mixpanel (Actions) and add it.
  3. Paste your Mixpanel project token and any other required settings (such as API secret or region), following Segment’s destination docs.
  4. Save, but leave it disabled until mappings are reviewed.

Step 3: Review the default mappings

The Actions destination comes with default mappings. Mixpanel’s docs summarize them roughly as:

Segment callMixpanel action
track where event = “Order Completed”Import event “Order Completed” (with ecommerce handling)
Other track callsImport event
identifyIdentify user and set profile properties
pageImport a “Viewed {name}” event
groupIdentify group

Open each mapping and check:

  • Event names. Segment’s spec uses Title Case names like “Order Completed”. If your Mixpanel tracking plan uses snake_case (post 4), decide now which convention wins. Mixing both creates duplicate-looking events.
  • Page events. “Viewed {name}” creates a different event name per page. Many teams prefer one page view event with a page name property, so consider changing this mapping.
  • Properties. Make sure the properties you rely on (revenue, currency, plan) map through with the right names and types.

Step 4: Get identity right

When you call Segment’s identify with a userId, Mixpanel sets that userId as the distinct ID and applies traits as profile properties. A few rules:

  • Use a stable database ID as userId, never an email (post 2).
  • Call identify on signup, login, and when the app reopens already logged in.
  • Make sure Segment’s anonymousId flows through on anonymous events so pre-login activity can merge with the user.
  • Check Segment’s destination docs for how the anonymous ID and user ID are mapped for your ID Merge version, and test the full anonymous → signup → login journey before going live.
  • Segment’s alias call is tied to Mixpanel’s older identity behavior; RudderStack’s and Segment’s docs both note that alias isn’t used with Simplified ID Merge. Don’t add alias calls to a Simplified project.

Step 5: Set up groups properly

This is the most common silent failure. Mixpanel’s Segment docs describe the steps:

  1. Create the group key in Mixpanel project settings, for example company_id.
  2. Configure the group mapping in Segment. If you don’t specify a group key in the mapping, Segment defaults to $group_id, in which case your Mixpanel group key should be $group_id. If you created company_id, enter that as the group key and map Segment’s groupId to the group ID.
  3. Call group() to create group profiles with properties such as name and plan.
  4. Add the group key as a trait in identify so user profiles link to groups.
  5. Add the group key as a property on every track event. Mixpanel’s docs are explicit: the event must carry the group key and value as an event property, or it won’t be connected to the group.
analytics.track('Report Exported', {
  company_id: 'acme-inc',
  format: 'pdf'
});

The easiest way to do step 5 consistently is to add the group key in Segment’s context or a middleware that runs on every event.

Step 6: Test

  1. Point the destination at a dev Mixpanel project first.
  2. Enable the destination and use Segment’s Event Tester or debugger to send test events.
  3. In Mixpanel’s Events view, confirm events, properties and the distinct ID.
  4. Walk through anonymous browsing → signup → login, then check the Mixpanel profile has one merged history.
  5. Check a group profile shows events from its users.
  6. Switch to the production project.

Mixpanel’s older help docs also note that you can tell how an event arrived by its library property, which helps when debugging device mode vs cloud mode.

Step 7: Monitor delivery

Check Segment’s Event Delivery tab for the Mixpanel destination regularly. Failed deliveries usually mean validation problems, such as too many properties or a bad timestamp, which you’ll see in the error details. Pair this with a Mixpanel alert on daily event volume (post 30).

Mistakes to avoid

  • Using Classic for a new setup.
  • Two naming conventions (Segment Title Case and your own snake_case).
  • Default page mapping creating hundreds of “Viewed X” events.
  • Group key missing on track calls.
  • Email as userId.
  • Sending to production before testing identity.
  • Running Segment and the Mixpanel SDK side by side for the same events, causing duplicates.

Final thoughts

Segment makes getting data into Mixpanel easy. Making that data trustworthy takes a little more care: the Actions destination, one naming convention, deliberate mappings, a stable user ID, and group keys on every event.

Sources