should I use .reset() method when user logged out for group propertiy?
Hi hanjuuu, 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
Yes, you should call the .reset()
method when a user logs out, especially if you're handling multiple users on a single device. This is a best practice for Mixpanel's identity management.When a user logs out, calling .reset()
will:
- Clear the local storage
- Generate a new $device_id
for the next session
- Help properly separate user data when multiple people use the same deviceThis approach is recommended in Mixpanel's documentation across various SDKs: Identifying Users (Simplified) specifically states: "Call .reset
upon logout or when an app leaves an authenticated-state."The typical implementation pattern is: ```// your user logs out and tracks a log out event
mixpanel.track('log out');
// clear local storage and generate new distinct_id mixpanel.reset();```This pattern is consistent across all Mixpanel SDKs including JavaScript, iOS, Android, and others.This approach ensures that group properties and user data are properly separated between different users of the same device.
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! 📚
Based on the knowledge sources provided, there isn't specific information about resetting group properties when a user logs out. The documentation focuses on user identity management through the .identify()
and .reset()
methods, but doesn't explicitly address how group properties should be handled during logout.The .reset()
method is primarily recommended for clearing user-specific data when a user logs out, particularly to handle multiple users on a single device. As mentioned in the documentation: "Call .reset()
upon logout or when an app leaves an authenticated-state" to "generate a new $device_id
for your user, ensuring that multiple users that are sharing a single device would not be incorrectly considered as a single user tracking events with the same IDs." Identifying Users (Simplified)If you're concerned about group properties specifically, you might want to contact Mixpanel support for more detailed guidance, as the provided knowledge sources don't contain enough information about handling group properties during user logout scenarios.The general best practice would be to follow Mixpanel's identity management recommendations for user logout, but the specific handling of group properties may depend on your implementation and use case.Is there anything specific about group properties that you're trying to address?
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.