Mixpanel Community Icon

Understanding the Distinct ID Property in Event Tracking

·
·

Some events has property called distinct id before identity, what is that

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

    Hi Mohamed B., 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
    ·
    ·

    The $distinct_id_before_identity is an internal Mixpanel property used to track an event's original $distinct_id before it was updated due to identity merging. This property is used in both the Original ID Merge and Simplified ID Merge systems of Mixpanel. In the context of Mixpanel's ID Merge feature, identity merging refers to the process of linking different identifiers (like $device_id and $user_id) to a single user. The $distinct_id_before_identity property helps keep track of the original identifier that was used for a user before this merging process took place.For more details, you can refer to the Mixpanel documentation on Events and Properties.

    kapa.ai is still learning and improving, please let me know how I did by reacting below

    ⤵️ Hint: Mention @kapa.ai in the thread for follow-ups.

  • Avatar of Mohamed B.
    Mohamed B.
    ·
    ·

    kapa.ai i found that my user id is iverrited by device id, how can that happen

  • 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
    ·
    ·

    In Mixpanel, the $device_id is used to associate events to the same anonymous user. When a user signs up or logs in, you should call .identify(<user_id> ) to map the user's known user_id to their $device_id. This process is known as identity merging.Here's an example of how it works:1. A user begins using a new device. At this point, the user is anonymous and events are associated with a $device_id. 2. The user logs in. You call .identify(U1), which links the $device_id to their $user_id. This means that events are now associated with the user_id instead of the device_id. 3. If the user logs out, you should call .reset(), or manually generate a new $device_id. A new user can then use this new $device_id to track events.If your user_id is being overridden by the device_id, it could be because the .identify() function is not being called correctly when the user logs in, or the .reset() function is not being called when the user logs out.You can refer to the Mixpanel documentation on identifying users for more details.

    kapa.ai is still learning and improving, please let me know how I did by reacting below

    ⤵️ Hint: Mention @kapa.ai in the thread for follow-ups.