Mixpanel Community Icon

Understanding User ID vs Distinct ID in Mixpanel

·
·

What is the difference between user id vs distinct id in Mixpanel? Should i use user uuid for both, or should I use uuid for distinct id and email for user id?

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi Moon L., 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

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    In Mixpanel, there's an important distinction between user ID and distinct ID. Let me explain the difference and provide recommendations based on the information from Mixpanel's documentation:1. Distinct ID: The distinct ID is Mixpanel's internal unique identifier for a user. It's used to determine user uniqueness across devices and sessions Identity Management Overview. 2. User ID: The user ID (device_id (which is typically a UUID) and use it as the distinct_id Identifying Users (Simplified).- For user ID: Mixpanel recommends using an ID that is unique to each user and does not change, such as a database ID. While using an email as the user ID is possible, it's not recommended because if the user changes their email, they would count as a separate user Identifying Users (Simplified) FAQ.Therefore, the best practice would be to use a UUID for the distinct ID (which is often handled automatically by Mixpanel's SDKs) and a persistent, unique identifier (like a database ID) for the user ID. Using email for the user ID is not recommended due to the potential for changes.

    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.

  • Avatar of Moon L.
    Moon L.
    ·
    ·

    kapa.ai if user is not allowed to change email then is email a fine user id? or is uuid still preferred

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Let me check the knowledge base for you again. One moment! đź“š

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    While using an email as a user ID is possible if users are not allowed to change their email addresses, it's still generally recommended to use a UUID or another persistent unique identifier for the user ID in Mixpanel. Here's why:1. Best Practice: Mixpanel recommends using an ID that is unique to each user and does not change, such as a database ID. Even if your current policy doesn't allow email changes, it's better to follow this best practice for long-term flexibility Identifying Users (Simplified) FAQ.2. Future-proofing: Your business policies might change in the future to allow email changes. Using a UUID from the start prevents the need for a complex migration later.3. Privacy Concerns: Using email addresses as identifiers can potentially expose personal information. A UUID is more privacy-friendly.4. Consistency: Using a UUID aligns with the distinct ID format, which is typically a UUID, making your identification system more consistent Identifying Users (Simplified).5. Flexibility: A UUID allows you to associate multiple email addresses with a single user if needed in the future (e.g., work and personal emails).Therefore, while using an email as a user ID could work if emails never change, it's still preferable to use a UUID or another persistent unique identifier for the user ID. This approach provides more flexibility and aligns better with Mixpanel's recommendations and best practices for identity management.

    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.