How do I move from event properties to user properties in Mixpanel?
Hi Novindra P., 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
To move from event properties to user properties in Mixpanel, you need to understand the difference between them and then use the appropriate methods to set user profile properties.
Understanding the Difference
Event properties describe actions that happen at a specific point in time, while user properties describe the user as they exist in the current moment: - Event Properties: Details about an event that are immutable (cannot be changed once tracked) - User Properties: Demographic attributes about a user that are mutable (can be updated) What is Mixpanel?
Setting User Profile Properties
To move data from event properties to user profile properties, you need to: 1. Identify the user first using the identify()
method
2. Set the user properties using the appropriate SDK methodHere's how to do it in different SDKs:
JavaScript
mixpanel.identify('12345');LBKS// Set user's "Plan" profile prop to "Premium"
mixpanel.people.set({
'plan': 'Premium',
'email': 'joe.doe@​[example.com](http://example.com)'
});LBKS```
React Native
mixpanel.identify('12345');
mixpanel.getPeople().set('plan', 'Premium');LBKS```LBKS[Mixpanel SDKs: React Native](https://docs.mixpanel.com/docs/tracking-methods/sdks/react-native#storing-user-profiles)
iOS (Swift)
Mixpanel.mainInstance().identify(distinctId: "12345")LBKS// Set user's "Plan" profile prop to "Premium"
Mixpanel.mainInstance().people.set(properties: ["plan":"Premium", "$email":"joe.doe@​[example.com](http://example.com)"])LBKS```LBKS[Mixpanel SDKs: iOS (Swift)](https://docs.mixpanel.com/docs/tracking-methods/sdks/swift#storing-user-profiles)
Important Considerations
1. Distinct ID: Make sure you use the same distinct ID for both events and user profiles to ensure they join correctly.2. When to Use User Properties: User properties are best for demographic attributes like name, email, and domain. Most other properties are better tracked as event properties. User Profile FAQ3. Retroactive Joining: User profiles join with events retroactively, so you don't need to track them at the same time as events. As long as they have the same distinct ID, they'll join with all past events.4. Latest State Only: Events join with the latest state of a user profile. If you need to analyze changes in a user's state over time, track that as an event property instead.Remember that user profiles are optional in Mixpanel, and it's recommended to start with events and add user profiles only if needed for your analysis.
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.