Building Segmentation Expressions

 For JQL and Data Export API only

This article is about Segmentation Expressions for JQL or the Data Export API.

The easiest way to build segmentation expressions is by looking at the requests within the standard Mixpanel Segmentation report. Find the on/where parameters for segmentation API requests:

  1. Open up your Mixpanel project, click Segmentation, then chose an event and property.
  2. Open up the developer console (on Chrome, Ctrl + Shift + J for Windows/Linux; Cmd + Opt + J for Mac) > Network, and search for “segmentation.”
  3. Scroll down to Query String Parameters in the XHR request to find “on.”
  4. Filter your property by selecting the arrow to the right.
  5. Open the XHR request and scroll down to Query String Parameters to find “where.”


You can apply expressions to these where and on parameters to perform mathematical operations, logical operations, or typecasts. See additional technical documentation on writing segmentation expressions.

Examples of Selectors for Segmentation Expressions

Equals | (properties["$city"] == "Chicago")

Does not equal | (properties["$city"] != "Chicago")

Contains | ("Facebook" in properties["$referring_domain"])

Does not contain | (not "Facebook" in properties["$referring_domain"])

Set | (defined (properties["$device"]))

Not set | (not defined (properties["$device"]))

So if you wanted to create a segmentation expression where browser is Chrome and email does not contain, your where parameter would be:

(properties["$browser"] == "Chrome" and not "" in properties["$email"]) 
Did this answer your question?



Article is closed for comments.