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

An overview of property data types

Updated Jan. 3, 2014

Property Data Types

Data types in Mixpanel are automatically detected by our system. Here are the ones we support:

String

If a property value is sent as a JSON string and doesn't match any of the other data types, Mixpanel will treat it as a string. In reports, the event will be broken out by each unique value.

Example:

mixpanel.track('Account Created', {'Account Type':'Paid'});

If possible, when you send numbers, please do not send them as a string.

Numeric

Any value that is a number (both integers and decimals) will be treated as numeric by Mixpanel. Properties with numeric values can be displayed as histograms.

Examples:

mixpanel.track('Application Loaded', {'Load Time (ms)':1187});
mixpanel.track('Application Loaded', {'Load Time (seconds)':1.187});
Boolean

If the property value is either the JSON constant true or false Mixpanel will treat the property as a boolean.

Example:

mixpanel.track('Played Video', {'Ad Included': true});
Date

Mixpanel's engagement reporting (event tracking) accepts a wide variety of date formats. If possible we recommend use of the following format:

  • YYYY-MM-DDTHH:MM:SS
  • Dates sent in this format look like: 2012-02-27T21:46:48. This format is guaranteed to be apropriately type cast across both engagement and people reporting. Here is an example:
    mixpanel.track('Account Created', {'Date First Seen':'2011-10-27T21:46:48'}); 
    
    In additon to that, if any of the following appear as a property value in engagement (event based) data, Mixpanel will treat that value as a date:

    • yyyy-mm-dd
    • dd-mm-yyyy
    • yyyy/mm/dd
    • dd/mm/yyyy
    • a three letter month like Jan,Feb,Dec etc
    • a three letter day like Mon,Tue,Wed, etc

    If you attempt to send a unix timestamp as a date, Mixpanel will initially treat it as an integer, but in the reporting interface you will be able to tell Mixpanel to treat it as a date. You can also append a time.

    Examples:

    mixpanel.track('Account Created', {'Date First Seen':'2011-10-27'});
    mixpanel.track('Account Created',{'Date First Seen':'2011-10-27T08:23:59'})
    mixpanel.track('Account Created', {'Date First Seen':'27/10/2011'});
    mixpanel.track('Account Created', {'Date First Seen':'Oct 27 2011'});
    //Next line is Unix Epoch. Will be treated as number until typecast.
    mixpanel.track('Account Created', {'Date First Seen':1319703839}); 
    
    List

    To send a list of values (for example, the products in a shopping cart), send them as a JSON array. This will allow you, in the segmentation report, when you query for a particular item, show all events where that item was included in the list.

    Example:

    mixpanel.track('Order Successful', {'Products':['Leather Jacket','Helmet','Harley Davidson']});
    

    Forcing Mixpanel to use a certain property type

    In the Segmentation report, the data type that Mixpanel thinks a property is is indicated by the icon next to it in the drop down menu. Once you have selected the property, you can change the data type by hovering over it with your mouse, and using the dropdown menu on the right:

    Related Blog Posts