Mixpanel recommends calling .identify() (which triggers the $identify event) only for logged-in (authenticated) users because this method is intended to associate all activity—both before and after login—with a single, known user identity. If you call .identify() for anonymous users, you risk incorrectly merging anonymous activity with a specific user, which can lead to inaccurate user profiles and data.Specifically: - The value you pass to .identify() should uniquely and persistently identify a user across all their devices and sessions. Anonymous users, by definition, do not have such a stable identifier yet, so calling .identify() for them can create confusion and data integrity issues.
- Calling .identify() for anonymous users can result in multiple users being merged into a single profile if they share a device or browser, which is not the intended behavior.
- Mixpanel's best practice is to use .identify() only when you know the user's true identity (e.g., after login or registration), ensuring that all pre-login (anonymous) and post-login (identified) events are correctly stitched together for that user, and not incorrectly merged with others' data Managing User Identity - JavascriptManaging User Identity - AndroidTealium Integration.In summary, only calling .identify() for logged-in users ensures accurate user tracking and prevents data from different users from being merged incorrectly.
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.
Hi Lois, 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