I just logged out of our platform and continued navigating as an anonymous user. How come mixpanel is not stitching my identities?
Hi Elena M., 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
When you log out of your platform and continue navigating, Mixpanel is designed to treat you as a completely new anonymous user to prevent data from multiple people being merged into a single profile.Based on the knowledge sources, here is why your identities are not being stitched after logout:
1. The Role of .reset()
To handle identity correctly during logout, Mixpanel recommends calling the .reset() method. This function clears the existing $user_id and $device_id from local storage or cookies and generates a brand-new $device_id [Mixpanel SDKs: Javascript; Identifying Users (Simplified)]. Once .reset() is called, any subsequent actions you take are associated with this new, anonymous $device_id. These actions are intentionally not linked to your previous authenticated profile to ensure that if a different person uses the same device, their data isn't incorrectly attributed to you [Identifying Users (Simplified); Frequently Asked Questions].
2. How Stitching Occurs
Mixpanel only "stitches" or merges identities when it sees a connection between an anonymous ID and an authenticated ID. This typically happens in one of two ways:
** Sign-up/Login: When you log back in and call .identify(your_user_id), Mixpanel links the current anonymous $device_id to your $user_id [Identifying Users (Simplified)].
** Identity Cluster: In the Simplified ID Merge system, an identity cluster is formed the first time an event contains both a $device_id and a $user_id. After you log out and reset, that link is broken for new events until you authenticate again [Identifying Users (Simplified)].
3. Expected Behavior
It is expected behavior that your post-logout anonymous activity remains separate from your previous logged-in activity. If you want those events to be stitched to your profile, you must log back in, which will trigger the .identify() call and merge that specific anonymous session's data with your identified profile [Identifying Users (Simplified); Migrating to Simplified ID Merge].
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.
