what is the difference between distinct id and the user id? I also have one distinct id as property and the another distinct id as a user property
Hi Juan I., 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
In Mixpanel, there's an important distinction between distinct_id
and $user_id
:
Distinct ID vs User ID
Distinct ID is Mixpanel's core identifier used to uniquely track users in the system. It's the fundamental property that determines user uniqueness across all Mixpanel reports and analysis. When two events have the same distinct_id
, they're considered as being performed by the same user.User ID ($user_id
) is a property used specifically in Mixpanel's ID Merge system to identify users in an authenticated state. It's one of the reserved properties that helps with identity management.In the Simplified ID Merge system:
- $device_id
is used to track anonymous users
- $user_id
is used to track identified/authenticated users
- When both appear in the same event, Mixpanel creates a mapping to merge them togetherThe distinct_id
is then determined based on these properties:
- If an event contains only $device_id
, that value becomes the distinct_id
- If an event contains $user_id
, that value becomes the distinct_id
Identifying Users (Simplified) explains that when a user logs in and you call .identify(<user_id> )
, you're telling Mixpanel that the anonymous $device_id
belongs to a known user with ID user_id
.
Your Property Situation
Regarding having distinct ID as both an event property and a user property: This is actually a common practice. The distinct_id
is automatically included in events, but many implementations also store it as a user profile property to ensure consistent identification across Mixpanel's systems.As mentioned in the FAQ for Original ID Merge, Mixpanel recommends: "As a best practice, please set your chosen user ID as a separate user profile property and event property so that you can always query and see your own chosen user ID."This recommendation exists because the canonical distinct_id
that Mixpanel displays might not always be your preferred identifier, so storing your own ID as a separate property ensures you can always reference it.
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.
Let me check the knowledge base for you again. One moment! 📚
Based on your description, it sounds like you have a user in Mixpanel with:
1. A distinct_id
that's a long hash-like string of characters
2. A $user_id
that contains an email addressThis is a common implementation pattern in Mixpanel's identity management system. Here's what it means: The long hash-like distinct_id
is likely either:
- An automatically generated anonymous identifier (if using client-side SDKs)
- A hashed version of a user identifier (which is a privacy best practice)The email as $user_id
indicates this is an identified user who has logged in or registered.In Mixpanel's Simplified ID Merge system, when a user logs in, both identifiers get linked together in an identity cluster. This means all events from before login (tracked with the hash) and after login (tracked with the email) will be attributed to the same user.Using an email as the $user_id
is convenient but has some limitations:
- If the user changes their email, they'll appear as a separate user in Mixpanel
- It may raise privacy concerns since emails are personally identifiable informationProtecting User Data mentions: "If you want to analyze aggregate user behavior without being able to drill down into any particular user, we recommend generating a hash of some unique ID of the user and using that hash as the user's ID when you call the .identify()
method in our SDKs."For better identity management, Mixpanel recommends using a stable, non-changing identifier (like a database ID) as the $user_id
rather than an email that might change.Would you like me to explain more about how to optimize your identity management approach in Mixpanel?
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.
Let me check the knowledge base for you again. One moment! 📚
Based on your question about why some distinct IDs appear as hashes while others show as emails, this is directly related to how Mixpanel's identity management system works.
Why Different Types of Distinct IDs Appear
In Mixpanel's ID management system, the distinct_id
value can vary depending on: 1. User State: Whether the user is anonymous or identified
2. ID Merge System: Which ID merge system your project is using
For Anonymous Users
When a user first visits your site or app (before logging in):
- Mixpanel's client-side SDKs automatically generate a $device_id
(a random hash-like string)
- This becomes the distinct_id
for anonymous events
For Identified Users
When a user logs in and you call .identify()
with their email:
- The email becomes the $user_id
- This email then becomes the distinct_id
for subsequent events (in Simplified ID Merge)Identifying Users (Simplified) explains that calling .identify(<user_id> )
when a user logs in tells Mixpanel that the anonymous $device_id
belongs to a known user with that ID.
Why Some Users Show Email While Others Show Hash
There are several reasons why you might see this mixed pattern: 1. Partial Implementation: Some users may have triggered the .identify()
call while others haven't2. ID Merge System Behavior:
- In Simplified ID Merge, the $user_id
(email) becomes the distinct_id
- In Original ID Merge, the canonical distinct_id
is selected by Mixpanel from any ID in the cluster, which could be either the email or the hash3. Timing: It can take up to 24 hours for ID merging to fully propagate through Mixpanel's systemThe FAQ section notes: "The canonical distinct_id is selected by Mixpanel using any of the IDs inside of a cluster. This means that even after identifying your user, Mixpanel may choose your user ID or one of the other IDs inside of the cluster (such as the device ID) to serve as the displayed ID for the user. This is random and not user-configurable."This explains why you might see a mix of hash-like IDs and email addresses as distinct IDs in your Mixpanel project.
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.
kapa.ai I have this in the user profile with all this disntict ids: 1753e0d570685-0f529834515db8-7f25425c-29b80-1753e0d57088a 1753e0d570685-0f529834515db8-7f25425c-29b80-1753e0d57088a gustavodipaolo42@gimail.com what does it mean
Let me check the knowledge base for you again. One moment! 📚
1753e0d570685-0f529834515db8-7f25425c-29b80-1753e0d57088a 1753e0d570685-0f529834515db8-7f25425c-29b80-1753e0d57088a XXXX@gimail.com kapa.ai
Let me check the knowledge base for you again. One moment! 📚
Let me check the knowledge base for you again. One moment! 📚
Based on what you're describing, you're looking at a user profile in Mixpanel that shows multiple distinct IDs associated with the same user: - Two anonymous hash values (Anonmoushash1, Anonmoushash2) - The user's email addressThis indicates you're seeing an identity cluster in Mixpanel, which is a core concept in Mixpanel's identity management system. Here's what it means:
What This Identity Cluster Means
This user has been tracked across multiple sessions or devices before they identified themselves (logged in). The multiple IDs represent the user's journey: 1. Anonymous Hashes: These represent sessions where the user was not yet identified. Each hash was likely generated:
- When the user visited from different devices
- After a reset()
call was made (common when implementing logout)
- When using different browsers or apps2. Email as Distinct ID: This appears when the user logged in and you called .identify()
with their email as the user ID.This is exactly how Mixpanel's ID merge system is designed to work - connecting anonymous activity with identified user behavior to create a complete user journey.
How This Works in Mixpanel
In the Simplified ID Merge system, when a user logs in and you call .identify()
with their email, Mixpanel creates a mapping between the anonymous IDs and the user ID (email). This allows Mixpanel to attribute all events from those anonymous sessions to the same user.As noted in the Simplified ID Merge documentation, this mapping can take up to 24 hours to fully propagate through Mixpanel's system, but the user profile view (which you're looking at) updates in near real-time.The presence of multiple anonymous IDs suggests this user has interacted with your product multiple times before identifying themselves, which is valuable for understanding their complete journey.Would you like to know how to optimize your identity management implementation based on what you're seeing?
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.