i am experiencing an issue with distinct_id in Mixpanel. Returning users are often counted as new users, which inflates the number of new user signups. Is there a way to persist or fix the distinct_id per device to avoid this?
Hi 김태수 (., 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
The issue you're experiencing—returning users being counted as new users due to changes in their distinct_id—is commonly caused by the loss or regeneration of the device's unique identifier (distinct_id or $device_id). This typically happens if: - Users clear cookies or local storage (on web), or - The app is uninstalled and reinstalled (on mobile).When this happens, the Mixpanel SDK generates a new random distinct_id, causing Mixpanel to treat the returning user as a new user, which inflates your new user signup numbers.
How to Address This
1. Use Identify on Login/Signup
Always call identify(<user_id> )
when a user logs in or signs up. This links the current device's anonymous ID with the user's known ID, merging their activity and ensuring returning users are recognized as the same person—even across devices or after clearing storage. This is a best practice for both web and mobile implementations Identifying Users (Simplified).
2. Persist Anonymous ID (Optional, Advanced)
If you want to minimize the chance of a new anonymous ID being generated, you can persist the anonymous ID (e.g., in a cookie or local storage) and restore it if possible. However, this is limited by user actions (like clearing cookies) and platform restrictions.
3. Avoid Calling Reset Unnecessarily
Only call reset()
when a user logs out or you expect a new user on the same device. Calling reset()
at other times will generate a new $device_id and can fragment user identity Identifying Users (Simplified) - Best Practices.
4. Cross-Platform and Cross-Session Tracking
If your product is used across multiple platforms (web, mobile), always use the same user ID for identify()
on all platforms. This ensures that Mixpanel merges all device IDs into a single user profile Identity Management in Action.
5. Understand Limitations
If a user clears cookies or reinstalls the app, a new $device_id will be generated. However, once they log in and you call identify()
with their user ID, Mixpanel will reconcile and merge their data under the correct user profile Troubleshooting FAQ.
Summary Table
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.
how about removing all reset() logic from the code??
Let me check the knowledge base for you again. One moment! 📚
Removing all reset()
logic from your code is not generally recommended unless you are certain that your application never supports multiple users sharing the same device. The primary purpose of calling reset()
is to clear the current user's identity and generate a new anonymous ID when a user logs out, which prevents the next user on the same device from inheriting the previous user's identity. If you remove all reset()
calls: - On single-user devices: This is usually safe, and may help avoid hitting the 500 ID cluster limit in the Original ID Merge system, since unnecessary resets can generate many anonymous IDs and inflate the cluster size (Migrating to Simplified ID Merge).
- On shared devices: Not calling reset()
can cause events from multiple users to be merged into a single profile, since the next user will inherit the previous user's distinct_id. This can result in data from different users being attributed to the same profile, which is a significant data integrity issue (Identifying Users (Simplified) - Example User Flows; Troubleshooting FAQ).Best Practice:
- Only call reset()
when there is a definite intent to change users on the same device (e.g., when a user logs out and a new user is expected to log in). Avoid calling it unnecessarily, as frequent resets can lead to ID cluster bloat and data fragmentation (Identifying Users (Original) - Best Practices).If your app is strictly single-user per device, you can consider removing reset()
calls. Otherwise, keep reset()
for logout or user-switch scenarios to maintain accurate user tracking.
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.
Let me check the knowledge base for you again. One moment! 📚
Let me check the knowledge base for you again. One moment! 📚
If you have exceeded the identity cluster limit in Mixpanel (500 distinct IDs per cluster in the Original ID Merge system), new distinct IDs can no longer be merged into the same cluster, resulting in orphaned (duplicate) user profiles and a fragmented view of the user journey. Immediate Steps:Regarding recovery:If you need further remediation:Summary:
- Fix your reset()
logic immediately to prevent further issues.
- There is no self-service way to recover or merge clusters that have already exceeded the limit.
- Contact Mixpanel Support for further assistance if needed.If you need to review your implementation or get help with data cleanup, contact Mixpanel Support.
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.
If you have exceeded the identity cluster limit in Mixpanel (500 IDs per cluster in the Original ID Merge system), new distinct IDs can no longer be merged into the affected cluster, resulting in orphaned (duplicate) users and fragmented user journeys. To resolve or recover from this issue:Summary:
You cannot merge additional IDs into a cluster that has reached the 500 ID limit. The best course of action is to fix your reset()
logic to prevent further issues and consider migration or support intervention if the problem is severe (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.