give me an explanation on the difference between distinct_id, user_id and idenitfy events
Hi Kayed C., 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, distinct_id
, $user_id
, and identify events are key components of identity management that help track users across sessions and devices. Here's an explanation of their differences:
distinct_id
The distinct_id
is Mixpanel's core identifier used to uniquely track users in the system: - It's the primary property that determines user uniqueness in Mixpanel
- When two events have the same distinct_id
, they're considered as performed by the same user
- It's essential for features like Insights reports (for unique user counts), Funnels (tracking conversion journeys), and User profiles
- For profile updates, it's referenced as $distinct_id
instead of distinct_id
Identity Management Overview explains: "Distinct ID is Mixpanel's identifier used to uniquely track a user in the system. Every event data and profile update sent to Mixpanel should have a distinct_id property associated with it."
$user_id
The $user_id
is a specific event property that represents an authenticated user: - It's typically set when a user logs in or signs up
- In Simplified ID Merge (newer system), when an event contains a $user_id
, that value becomes the distinct_id
for the event
- It represents the known identifier for a user (like a database ID)
- When both $user_id
and $device_id
appear in the same event, Mixpanel creates an identity mapping between themIdentifying Users (Simplified) states: "Calling identify(<user_id> )
sets the user_id
value passed to the identify function as the $user_id
event property for the user's events moving forward."
Identify Events
Identify events are mechanisms to link anonymous users to known users: - In Original ID Merge: The $identify
event is a special event type used to link an Anonymous ID and your chosen User ID
- It's triggered when you call .identify(<user_id> )
using Mixpanel's SDKs
- In Simplified ID Merge: No special event is needed - just including both $device_id
and $user_id
properties in the same event creates the mapping
- This process allows Mixpanel to stitch together pre-login and post-login behaviorIdentifying Users (Original) explains: "The $identify
event is used to link an Anonymous ID and your chosen User ID together."
Key Differences by ID Merge System
Mixpanel has two ID merge systems with different approaches: Simplified ID Merge (newer):
- Uses $device_id
and $user_id
properties directly on events
- The $user_id
always becomes the distinct_id
- No limit on how many $device_id
s can be merged to a single $user_id
Original ID Merge (older):
- Uses special events ($identify
, $merge
, $create_alias
) to manage identities
- The distinct_id
is automatically determined by Mixpanel from the ID cluster
- Limited to 500 IDs per clusterUnderstanding these differences is crucial for properly implementing user tracking in Mixpanel and ensuring accurate analytics across user sessions and devices.
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.