Solved

Difference between register and people.set?

  • 11 September 2018
  • 2 replies
  • 467 views

Userlevel 3
Badge

Hi,

I'm not sure of the difference between register and people.set?

I'm want to track a signup event. So I need to create a new people profile.
And I'd like the properties associated to this new people to be attached to further other events.

And then if I want to update some user's properties. Which one should I use?

Many thanks


icon

Best answer by michael 11 September 2018, 00:12

Hi @sarah.horton

Michael here from Mixpanel Support - happy to help!

The mixpanel.register() method is used to create super properties whereas mixpanel.people.set() calls are used to create people properties. The difference is that super properties are stored in the cookie and are sent with every event. Since they are "super" event properties, these values will not be able to be changed once they've been sent with the event. People properties can be updated to reflect the current value.

For example, if a new user had a property of "Plan" where the value is "Free", you could call:

mixpanel.register({"Plan":"Free"});
mixpanel.people.set({"Plan":"Free"});
mixpanel.track("Logged In");

This would send an event property of "Plan":"Free" with that event of Logged In. Now if that user were to upgrade to a Paid plan, you would say:

mixpanel.register({"Plan":"Paid"});
mixpanel.people.set({"Plan":"Paid"});
mixpanel.track("Logged In");

That second "Logged In" event would have the property value of "Paid" and the first one will still have the property value of "Free". Since you filter by event properties and people properties in Mixpanel's Engagement reports, if you were to filter the "Logged In" event by the people property of "Plan", you'd see both events as "Paid" because that is the current value associated with the distinct_id that was sent with both events. However, if you filtered by the event property of "Plan", you'd see "Free" for the first event and "Paid" for the second event because those were the super property values at the time of the event.

You can use the people properties to filter off of in events, so you should use mixpanel.register() method for any values that might change over time, and the mixpanel.people.set() method for all values that you want to tie to the user. If you update the people properties, you'll lose the previous value and there will not be a history of that value in your project. So depending on your use case, you may want to use the register and people.set() methods together.


View original

2 replies

Userlevel 4
Badge +2

Hi @sarah.horton

Michael here from Mixpanel Support - happy to help!

The mixpanel.register() method is used to create super properties whereas mixpanel.people.set() calls are used to create people properties. The difference is that super properties are stored in the cookie and are sent with every event. Since they are "super" event properties, these values will not be able to be changed once they've been sent with the event. People properties can be updated to reflect the current value.

For example, if a new user had a property of "Plan" where the value is "Free", you could call:

mixpanel.register({"Plan":"Free"});
mixpanel.people.set({"Plan":"Free"});
mixpanel.track("Logged In");

This would send an event property of "Plan":"Free" with that event of Logged In. Now if that user were to upgrade to a Paid plan, you would say:

mixpanel.register({"Plan":"Paid"});
mixpanel.people.set({"Plan":"Paid"});
mixpanel.track("Logged In");

That second "Logged In" event would have the property value of "Paid" and the first one will still have the property value of "Free". Since you filter by event properties and people properties in Mixpanel's Engagement reports, if you were to filter the "Logged In" event by the people property of "Plan", you'd see both events as "Paid" because that is the current value associated with the distinct_id that was sent with both events. However, if you filtered by the event property of "Plan", you'd see "Free" for the first event and "Paid" for the second event because those were the super property values at the time of the event.

You can use the people properties to filter off of in events, so you should use mixpanel.register() method for any values that might change over time, and the mixpanel.people.set() method for all values that you want to tie to the user. If you update the people properties, you'll lose the previous value and there will not be a history of that value in your project. So depending on your use case, you may want to use the register and people.set() methods together.


Userlevel 4
Badge +2

Here is a resource from our help center that breaks down the differences between Event, Super, and People Properties

https://help.mixpanel.com/hc/en-us/articles/115004708186-Event-Properties-Super-Properties-People-Properties


Reply