If you ever need help, please email us at support@mixpanel.com
Back to topics

A tutorial on using properties

Updated Sept. 11, 2012

What are properties?

Properties are pieces of extra information about an event that will let you slice and dice your data in extremely powerful ways. Many of our customers use properties like origin (where a user came from), age (how old the user is), level (what level the user is in a game), etc.

It is best practice to name your properties in a way that is easy for anyone to understand. Do not send them with estoeric abbreviations or create extremely long values. Instead of V-P, send "Video Play."

How to use properties

Properties are just a key-value dictionary/hashmap:

{"origin": "Twitter", "age": 13, "level": 17, "facebook_connected": true}

Here are some important things to know:

  • You can set them to be anything you want - it's totally arbitrary.
  • You can define as many as you want
  • If you set things that are numbers, make sure they are numbers and not strings. Check out our article on data types with properties.
  • You always send them with events

Javascript example

In this example, imagine you were YouTube and you wanted to track the gender of the user, where they came from, and how long the video was played for:

    mixpanel.track(
        "Video Played", // Event
        {
            "gender": "male", // Property
            "source": "google", 
            "keyword": "free video streaming", 
            "duration": 300
        }
    );