User Profile Properties & Identity Resolution (Distinct ID & User Aliasing)
Overview & Learning Objectives
How does Mixpanel know that the anonymous visitor who browsed 5 shoes on their laptop on Tuesday is the exact same human who logged into their account on an Android phone on Thursday and bought the shoes? The secret is Identity Resolution. In this lesson, you will master Mixpanel's Distinct ID system, the `identify()` method, the `alias()` method, and how to prevent split user identities.
- Understand how Mixpanel assigns anonymous UUIDs (`$device_id`) before login.
- Implement `mixpanel.identify(user_id)` and `mixpanel.alias(user_id)` on signup.
- Prevent duplicate profile creation and identity stitching bugs during multi-device sessions.
Real-World Example: The Masked Detective Who Unmasks at the Castle Door
- Scenario: A masked carnival guest browsing booths anonymously before removing the mask at the VIP entrance.
- Distinct ID: An anonymous cookie ID tracks pre-login activity until user authentication occurs.
- Identity Merge: Mixpanel/GA4 stitches anonymous history to the verified User ID so historical attribution remains unbroken.
Visual Infographic: How Mixpanel Identity Stitching Works
IDENTITY INFOGRAPHICUser lands on website -> Given anonymous `$device_id: "anon_99182"`.
User enters email and creates account with database `user_id: "usr_4021"`.
Mixpanel stitches all past anonymous clicks to `usr_4021`.
Calling `identify("usr_4021")` on mobile links phone to the same profile!
Industry Standard & Framework
Standard: Mixpanel Simplified Identity API & Distributed Graph Resolution Standards.
Real-World Business Application: Zerodha Kite Cross-Platform Identity Resolution
Zerodha tracks investor stock research across anonymous desktop landing pages and authenticated mobile trading apps.
| User Lifecycle Stage | Mixpanel Method Called | Distinct ID Value | Data Stored |
|---|---|---|---|
| Anonymous Landing Page Visit | SDK Auto-Generated | `"$device:d8a9f-3312"` | Ad campaign source, referral link, 3 stocks viewed |
| Account Registration Complete | `mixpanel.alias("ZER_9921")` | Linked to `"$device:d8a9f-3312"` | Permanent alias bridge established |
| Subsequent Login on iPhone | `mixpanel.identify("ZER_9921")` | `"ZER_9921"` | Past web history now merged with iPhone app sessions |
| User Logs Out | `mixpanel.reset()` | New anonymous `$device_id` | Prevents next user on shared laptop from sharing cookies |
Step-by-Step UI Tutorial & Visual Workflow Guide
Below is the practical, non-technical walkthrough showing how Product Analysts design, review, and execute this capability inside real-world tools like Mixpanel, Google Analytics 4, BigQuery, and Google Tag Manager.
Step-by-Step Execution Workflow
EXECUTION PHASESAutomatically generates a unique device GUID stored in browser localStorage or iOS Keychain.
On successful user registration response, trigger `mixpanel.alias(user_id)`.
On user login, trigger `mixpanel.identify(user_id)` and populate User Profile properties (`$email`, `plan`).
On logout button tap, call `mixpanel.reset()` to generate a clean anonymous ID.
Search for test user ID in Mixpanel "Users" tab to verify anonymous and authenticated events appear on one unified timeline.
Step-by-Step UI Tutorial: Inspecting User Profiles & Event Streams in Mixpanel
In Mixpanel left sidebar, click "Users" -> "Explore".
Type a user's distinct ID or email address in the search filter.
Look at the left panel to see lifetime spend, country, signup date, and total sessions.
Scroll through the center timeline to see every single event the user performed from Day 1 to today.
Identity Resolution Methods Cheat Sheet
SDK METHODS| method | when To Call | action Taken |
|---|---|---|
| `mixpanel.identify(id)` | On every successful login or session restore | Sets current Distinct ID to the authenticated user ID |
| `mixpanel.alias(new_id)` | Once only, immediately after account signup | Permanently links pre-signup anonymous history to new user ID |
| `mixpanel.reset()` | Immediately when user taps "Log Out" | Clears user cookies and creates a brand-new anonymous ID |
| `mixpanel.people.set({})` | Whenever user profile info updates | Saves permanent traits: name, subscription, phone |
Implementation Guidelines for Product Analysts
- Never call `mixpanel.alias()` multiple times for the same user, as this can corrupt identity graphs in legacy implementations.
- Always call `mixpanel.reset()` on logout to ensure shared office or family computers don't pollute user profiles.
- Never use email addresses as your primary Distinct ID because users may change their email address later.
Practical Hands-On Exercises
- What happens if an engineer forgets to call `mixpanel.reset()` when User A logs out and User B logs in on the same tablet?
- Explain the difference between `$device_id` and `user_id` in Mixpanel.