People Properties Best Practices

People analytics leverages the people property in each profile to enable you to send targeted messages to your users.

You can set people properties using five data types:

  • String
  • Numeric
  • Boolean
  • Date
  • List  

Each of these data types allows you to create differently targeted campaigns. Sometimes the differences in the properties can be subtle.

For more information about sending data types to Mixpanel, see Properties: Supported Data Types.  

String

String properties store a one-to-one mapping between a property name and a value:

mixpanel.people.set({"Plan type": "Paid"});

Numeric

Numeric properties store integers and decimals to track how many or how much:

mixpanel.people.set({"Plan purchase amount": 50});

Any numeric properties can be incremented:

mixpanel.people.increment("Count of logins after purchase");

Boolean

Boolean properties store a true/false property that you can toggle, based on the user’s state:

mixpanel.people.set({"Paid Plan": true});

Date

Date properties store when something happened, or when an event will occur:

mixpanel.people.set({"Date of Plan Purchase": "2015-02-27T21:46:48"});
// the date property should be ISO formatted in UTC time
mixpanel.people.set({"Date of Plan Purchase": new Date().toISOString()});

List

List properties store sets of properties that correspond with one property name:

mixpanel.people.set({"Plans purchased": ["Entry level", "Gaming", "Photo Share"]});

Lists can be extended with our append method:

mixpanel.people.append({"Plans purchased": "Pro"});

Lists can be merged with union, which only adds a list element if it doesn’t already exist in the list:

mixpanel.people.union({"Plans purchased": "Pro"});

As soon as your properties are stored in the profile, you can begin creating highly targeted campaigns that take advantage of all the information you have stored.

Recommendations

Here’s some advice to help you get the most out of your people profiles:

  • Before you start, determine the key types of messages you’d like to send.
    You can trigger people profile updates from actions that happen on your page. If you want to send a message to your users when they view your Help pages, you could set a property once they’ve viewed your Help pages. Similarly, if you want to check in with your users two days after they viewed a Help page, you could store the date of the last time they viewed a resource.

  • Store date or numeric data types instead of booleans when possible.
    Because Mixpanel allows you to cast people properties on the fly, a Date property type can be cast as a Boolean. If it is set, it will resolve to True. If it is not set or doesn’t exist on that profile, then it will resolve to False. For example, instead of “Has used Our Awesome Feature?” you could set “Last Awesome Feature Use” as a date and increase your power without cluttering your profiles or your code.

  • Store similar information in different ways.
    Storing the last plan purchased as a string indicates the current plan that the user has. But if you append the plan to a list, you would have access to all their past plans as well. It is also a really good idea to store much of this information as super properties so you have access to this information in your events that you send into Mixpanel.

  • Use Mixpanel’s special and reserved people properties.

 

 

 

 

 

 

 

Is this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.