Building Segmentation Expressions

 For JQL and Data Export API only

This article is about Segmentation Expressions for JQL or the Data Export API. To view help articles on our Segmentation report check out this section.

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 Insights, 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.”

2016-07-28_23_04_52.091032-on_where_2.gif

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 @yourdomain.com, your where parameter would be:

(properties["$browser"] == "Chrome" and not "@yourdomain.com" in properties["$email"])
Is this article helpful?
9 out of 30 found this helpful

Comments

0 comments

Article is closed for comments.