You're correct that in Mixpanel, user properties are attributes that describe a user, and these are stored within the user's profile. In Mixpanel terminology:
- User Profile: This is the record or object in Mixpanel that represents a user. It is identified by a unique distinct_id and contains all the user properties for that user.
- User Properties: These are the key-value pairs (like name, email, plan, etc.) that are stored on the user profile. They describe the current state or characteristics of the user.
When you update a user property (for example, if a user changes their in-app profile or switches between different profiles), you need to update the corresponding user properties in Mixpanel. The user profile in Mixpanel will then reflect the latest values you set. Mixpanel always joins events with the latest state of the user profile, not the state at the time the event occurred. This means if you change a user property, all future queries will use the new value, even for past events performed by that user.
If you want to track changes over time (for example, if a user switches between different in-app profiles), you should consider tracking the profile information as an event property on each event, rather than (or in addition to) as a user property. This way, you can analyze historical changes, since event properties are immutable and reflect the state at the time of the event, while user properties always show the latest state.
Here are some relevant points from the documentation:
- "User Profiles let you enrich events with demographic attributes (i.e. user properties) about the users that performed those events... A user profile has a set of user properties associated with a given user."
User Profile: Demographic attributes for your users
- "All Events join with the latest state of a User Profile, rather than its state at a point in time. If there are aspects of a user’s state that change over time (for example, their plan type), we recommend tracking that as a property on their events, so that you can analyze that change over time."
User Profile FAQ
So, your understanding is correct: user properties are tied to the user profile, and updating them will update the profile in Mixpanel. But if you need to analyze historical changes, use event properties for those attributes that change frequently.