Custom Properties

Create custom properties in order to combine different properties or to restrict the property to specific values. Using a combination of properties, functions, numeric operators, and comparison operators described below, your properties can be customized to your exact specifications.

This feature is in a closed BETA and is currently only available in the Insights report. Please send an email to insights@mixpanel.com if you have questions, comments, suggestions, and reach out to your customer success manager if you would like to request access to the feature.  

Create a Custom Property

Take existing event or people properties and use Excel-like formulas to transform those properties and create new properties. 

Example use-cases include:

  • Create custom buckets to group your property values into
  • Merge property values to fix implementation issues
  • Create new properties based on the values of different properties

tempsnip.png

Click Custom event/people property to open the property builder. If you select this option under EVENT PROPERTIES you will only be able to select event properties to build your custom property from. If you select this option under PEOPLE PROPERTIES you will only be able to select people properties.

Screen_Shot_2019-07-22_at_1.21.52_PM.png

Enter a name and description for the custom property. Select one or more properties to combine and transform  Each property you select is given a letter code beside it, which you can use in the Transform field to create a formula which customizes the property.

Custom properties are temporary for the current report by default, but you can select the checkbox beside “Also save this property” to save the custom property permanently. The property will still only be available to use in Insights.

Functions

Use the following functions in the Transform field to modify your custom property: 

  • If : Evaluates if an expression is true or false.
    Example:
    if(condition, value if true, value if false)
  • Not : Returns values that are not true. 
    Example:
    not(condition)
  • And : Returns values that meet both conditions.
    Example:
    x and y
  • Or : Returns values that meet either condition.
    Example:
    x or y
  • In : Returns values if the first condition is contained in the second condition.
    Example:
    x in condition

Numeric Operators

Use the following numeric operators in the Transform field to modify your custom property using: 

  • + : Addition
  • - : Subtraction
  • * : Multiplication
  • / : Division

Comparison Operators

Use the following comparison operators in the Transform field to modify your custom property: 

  • < : The first number is strictly greater than the second number.
  • > : The first number is strictly less than the second number.
  • >= : The first number is greater than or equal to the second number.
  • <= : The first number is less than or equal to the second number.
  • == : The first argument is equal to the second argument. If both arguments are strings, the comparison is case-insensitive.
  • != : The first argument is not equal to the second argument. If both arguments are strings, the comparison is case-insensitive.

Use Cases

Custom Bucketing

Use custom properties to create arbitrary ranges of your numerical properties. This is applicable when you want to create age groups from age, income classes from salary and whatever other transformations of the numerical property that might be relevant to your business.

For example:

An insurance company wanted to calculate the total claims by age group, but is only tracking the age of the claimant. They want to specify the age groups as “0-15” as “Underage Drivers, “16-25” as “Young Adult Drivers”, “25-60” as “Adult Drivers” and “60+” as “Senior Drivers”.

They can create a custom property using “Age” to apply the age groups with this transformation: 

if(A<15,”Underage drivers”, if(A<25,”Young Adult Drivers”, if(A<60, “Adult Drivers”, “Senior Drivers”)))

Screen_Shot_2019-07-22_at_1.22.56_PM.png

Merge Values to Fix Implementation Issues

Use custom properties to combine multiple property values into one. This is helpful when customers want to take multiple variations of a property value (e.g. facebook, fb, fbsocial) and then combine them into one property value (e.g. facebook). 

If customers have been sending values into Mixpanel with variations (even though they may have been minor) and you want to correct this issue by grouping those values together. 

For example:

A marketing manager wants to understand what portion of the user base is coming through a social traffic acquisition path. They want to group all social channel values into a single value, and keep the rest of the channels as-is.

They can create a custom property using the channel with this transformation:

if((A=="Facebook") or (A=="LinkedIn") or (A=="Twitter"),"Social", A)

Screen_Shot_2019-07-22_at_1.25.09_PM.png

Create New Properties Based on Values of Different Properties

Use custom properties to create a new property using the values of multiple other properties.

For example:

A marketplace company wants to track total purchase amount for an order, but the per-unit price is passed as a property and the number of items is passed as a property. 

They can create a custom property using “price” and “quantity” with this transformation:

A*B

Screen_Shot_2019-07-22_at_1.31.47_PM.png

Modify Defined Properties

Use custom properties to create a new property if and only if a property is defined. 

For example:

A telco company charges its customers based on talktime (minutes spoken) and on apps purchased. If the company wants to track the average duration per minute, they would want to restrict the calculation to just the purchases for talktime (where duration (minutes) is defined). 

They can create a custom property using “Duration” and “Amount” with this transformation:

if(A, B/A, B)

Screen_Shot_2019-07-22_at_1.35.04_PM.png

This creates the following output:

Screen_Shot_2019-07-22_at_2.00.23_PM.png

Check whether Property Values Are the Same

Use custom properties to create a new property if two property values are the same.

For example:

A company wants to find out which percentage of purchases are being made by users that have changed countries since sign up.

They can create a custom property to determine whether the two country values are the same with this transformation:

if(A==B,”Same”,”Different”)

Capture.JPG

FAQ

Custom Group Properties

Creating custom properties from group properties is not currently supported.

Property Value is "Undefined"

If a property value is undefined, you can alter your formula as such:

if (A, {value if the property value is defined}, {value if the property value is not defined})

If you aren’t checking for that and you do a comparison operation (for e.g. if (A<10,”high”,”low”)), then A’s property values that are undefined will display as “low”.

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

Comments

0 comments

Article is closed for comments.