What is the right instruction to document in an analytics tracking plan when we want to set on login the user properties?
Hi event, 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 documenting instructions in your analytics tracking plan for setting user properties on login, you should specify that: - Upon successful login (or registration), you must call the identify method with the user's unique identifier (typically the user ID from your database). - Immediately after identifying the user, set the relevant user properties (such as name, email, plan, etc.) using the appropriate method for your SDK (e.g., people.set). - Ensure that these properties are only set for identified (logged-in) users, not anonymous users. - Avoid sending null, N/A, or empty string values for properties; if a property is unavailable, it is recommended not to send it at all. - Maintain consistent naming conventions and data types for all properties.**Example instruction for your tracking plan:> On user login (or registration), call identify with the user's unique ID, then set user properties (e.g., name, email, plan) using people.set. Only set properties for identified users. Do not send properties with null or empty values. Use consistent naming and data types for all properties.Example (JavaScript)::**LBKS```LBKSmixpanel.identify('USER_ID'); mixpanel.people.set({ '$name':: 'Jane Doe', '$email': 'jane.doe@​example.com', 'plan': 'Premium' // Add any other relevant user properties here });```This ensures that all user activity is correctly attributed and user profiles are accurately maintained in Mixpanel. For more details, see the Quickstart: Identify Users and Tracking Plan Methodology documentation.
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! 📚
Yes, the identify
function must be called before setting user profile properties. This is required so that Mixpanel knows which user the profile properties should be associated with. If you call the method to set user properties (such as people.set
or getPeople().set
) without first calling identify
, the profile update will be queued locally and only sent to Mixpanel after an identify
call is made in the same session.So, identify
is not only for associating the same user’s activities, but it is also required for setting user profile properties correctly.> You must call .identify()
before setting profile properties in order to associate the profile properties you set with the target user. If identify is not called, the profile update will be queued for ingestion until an identify call is made.
Mixpanel SDKs: Javascript – Storing User ProfilesThis requirement is consistent across Mixpanel SDKs, including JavaScript, iOS, Android, React Native, Flutter, and Unity.
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.