Mixpanel Community Icon

Preventing Mixpanel from Creating Duplicate Users When Switching Devices

·
·

How can I stop mixpanel from creating a new user every time I switch devices?

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

    Hi George K., 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
    ·
    ·

    To prevent Mixpanel from creating a new user every time you switch devices, you need to implement proper identity management. Here's how you can achieve this:1. Use the .identify() method: Call .identify() with a consistent user identifier (like a user ID from your database) when a user logs in or signs up. This links the current device to the user's identity.2. Implement cross-device tracking: Ensure you call .identify() on all devices where the user logs in. This will link events from different devices to the same user.3. Use .reset() correctly: Call .reset() only when there's an explicit intent to change to a new user (e.g., clicking on a "Sign-up" button), not just when a user logs out.Here's an example of how to use .identify():LBKSmixpanel.identify('<USER_ID> ');LBKSBy following these practices, Mixpanel will be able to recognize the same user across different devices, preventing the creation of multiple user profiles for the same person.For more detailed information on implementing proper identity management, you can refer to these resources:Identifying Users (Simplified) Identity Management in ActionRemember to implement this consistently across all platforms and devices where your application is used.

    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 George K.
    George K.
    ·
    ·

    Will the Distinct ID remain the same