I have a primary identifier as email, but sometimes I don't have access to the email, only a CRM id. Cam I pass the CRM id as well so that I can track users across devices
Hi Sebastian P., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
Based on the knowledge sources, Mixpanel's identity management capabilities vary depending on which ID management system you're using. Let me explain your options: If you're using Simplified ID Merge (Mixpanel's newer system), you can only have one User ID ($user_id
) per ID cluster, which serves as the canonical Distinct ID. This system doesn't support multiple User IDs per user.As noted in the documentation: "Simplified ID Merge supports only one User ID ($user_id
) per ID cluster... If you need an ID management solution that supports multiple User IDs per user, such as both an email address and a phone number, it's recommended to remain on Legacy ID Management or Original ID Merge." Migrating to Simplified ID Merge SystemIf you're using Original ID Merge, you have more flexibility. You can use the $merge
event to merge any two identifiers together. This would allow you to link your email identifier with your CRM ID: LBKS{ "event": "$merge", "properties": { "$distinct_ids": [ "email@​[example.com](http://example.com)", "crm_id_12345" ] } }LBKS
This event can only be processed when sent via the /import API directly, not through SDK methods. Identifying Users (Original)Alternatively, you could consider:
1. Using a consistent ID strategy where you always use one type of ID (like your CRM ID) as the primary identifier
2. Storing the email as a user property that you can query on, rather than using it as an identifierRemember that with any ID management approach, it's best to use an ID that is unique to each user and doesn't change. As Mixpanel notes: "While using an identifier like email may be more convenient, keep in mind that you cannot merge 2 $user_id
s or change a $user_id
, so if the user changes their email, they will count as a separate user." Identifying Users (Simplified) FAQ
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
How do I use the simplified id merge kapa.ai
Let me check the knowledge base for you again. One moment! 📚
Based on your previous question about tracking users with multiple identifiers, I'll explain how to use Simplified ID Merge in Mixpanel.
Using Simplified ID Merge
The Simplified ID Merge API uses the $device_id
and $user_id
event properties to determine the distinct_id
for your events. Here's how to implement it:
1. Check Your Project Settings
First, verify that your project is using Simplified ID Merge by checking your project settings. For new organizations created after April 2024, Simplified ID Merge is the default.
2. Client-side Implementation
If you're using Mixpanel's Web/Mobile SDKs, the implementation is straightforward: 1. Call .identify(<user_id> )
when a user signs up or logs in. Pass in your chosen identifier (like your CRM ID).
2. Call .reset()
when a user logs out.Under the hood, Mixpanel's SDKs automatically generate a $device_id
for anonymous users and attach it to all events. When you call .identify()
, both the $device_id
and $user_id
are included in events, triggering the identity merge. Identifying Users (Simplified)
3. Server-side Implementation
For server-side tracking, you need to: 1. Include $device_id
property on events for anonymous users
2. Include both $device_id
and $user_id
properties when the user is identifiedExample for anonymous event: LBKS{ "event": "View Anonymous Page", "properties": { "token": "YOUR_PROJECT_TOKEN", "$device_id": "anonymous111" } }LBKS
Example for identified user event: LBKS{ "event": "Sign Up", "properties": { "token": "YOUR_PROJECT_TOKEN", "$device_id": "anonymous111", "$user_id": "your_crm_id" } }LBKS
A single event containing both $device_id
and $user_id
is enough to trigger identity merging. Migrating to Simplified ID Merge
Important Notes
- With Simplified ID Merge, you can only have one $user_id
per identity cluster (as we discussed in your previous question)
- The $user_id
will always be set as the distinct_id
for the user
- There's no limit on the number of $device_id
s that can be merged into a single $user_id
- Identity merging may take up to 24 hours to fully propagate across all Mixpanel reportsRemember to use a consistent identifier that doesn't change (like your CRM ID) as the $user_id
rather than an email which might change over time.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.