Audience Segments offers a few different ways to segment your audience in the dashboard, isolating a subset of users while also maintaining a view for your entire readership. There are two primary types of segments:

  1. Segments based on standard data - Standard data supports segmenting by geography (based on Geo IP lookups), campaigns (based on UTM or ITM parameters), or referring URL.
  2. Segments based on custom data - Commonly used to segment by subscription or registration status, but can be based on any method you choose to better understand your audience.

Depending on your plan, segment tracking may result in additional charges. Contact your account manager or for more information.

#Audience segments integration overview

#Segments based on standard data

For geographic, campaign, or referrer segments, no integration changes are necessary. Simply contact your account manager or with the details of the segments you'd like to add.

#Segments based on custom data

Tracking subscription plans, registration status, or any other custom parameter requires some additional work by your development team. This involves making a small change to your integration so that the additional information gets sent as part of each pageview request.

Once you complete this work, will use the key/value pair you are sending as extra data with your pageview events and build the custom audience segment into your dashboard.

The most important takeaway is you need a method to find and get the data. As long as you have this segment defined somewhere else, and you have the ability to pull it out and put it into the pixel, you can track that segment in the dashboard.

#Example workflows

An example customer workflow for setting up segments might look something like this:

  1. The segment is defined somewhere in your marketing stack, and an API call is made to that marketing platform to check whether or not the request is from an identified user.
  2. A cookie is set that identifies the user in the segment. (This often used to happen client-side, but for security reasons increasingly these types of calls are made server-side).
  3. If the user is part of the defined segment in the marketing stack, the frontend code will make a pageview call to with the requisite key/value pair.
  4. The segmented users will then be visible in the dashboard as different audience segments

Here’s a practical example of that workflow from a well-known marketing platform, Marketo, where our intent is to track users who are paid subscribers or not paid subscribers in

  1. A user visits the webpage. The server uses the user's Marketo ID (stored in the "_mkto_track" cookie) to look up the user in the Marketo database.
  2. If the server finds a user, it will look at the user's data and see if they are a paid subscriber or not. If they are a paid subscriber, you will create a cookie called "paid_subscriber" and set it to true.
  3. When the request returns to the website, the client-side JavaScript checks that cookie. If that cookie exists, it uses the JavaScript library to send a pageview call to with the extra data attached (see sample code below). 
  4. Our system will read the pixel with extra data attached and categorize the view appropriately.

#Example code

Here's an example of what custom segment tracking code might look like for a user that is subscribed to a "basic" plan. This uses the recommened update defaults method:

window.PARSELY = window.PARSELY || {
  autotrack: false,
  onReady: function() {
      data: {
        plan: "basic"

<!-- START Include -->
<!-- ...insert the parsely tracker code here... -->
<!-- END Include -->


Any segmentation code must be placed before your standard Parsely tracking snippet.

In the example above, note that in the call to PARSELY.updateDefaults, we provide an object like this:

   data: {
      plan: "<name of plan>"

You must pass a data object that matches this shape. Within the data object, you can use whatever key/value strings best describe your business logic. For example, the following would also be valid:

   data: {
      user_type: "anonymous",
      content_type: "free"

Booleans may also be used, as in this example:

   data: {
      Logged_in: true,

In a real integration, the value of each data property will be set by your business logic. This means that any value you intend to use for segmentation must be available client-side by the time the tracker loads. It's also important to consistently handle null values; in the example above, if a current user isn't subscribed to any plan, you would have to choose between setting data.plan to null or simply skipping the call to PARSELY.updateDefaults.

#Custom audience segments integration using Google Tag Manager (GTM)

If you used Google Tag Manager (GTM) to implement the tracker, please follow these instructions to set up your segments with a separate tag:

  1. Use a tag to call PARSELY.updateDefaults and set the segment code before the tracker loads.
  2. Sequence the tags so that the defaults are updated before the tracker is loaded.

#Valid values

Value strings are treated as case-sensitive by default.

Segmentation values should represent general categories of users. Sending personal information like names or email addresses is ineffective for creating segments, and a violation of our terms of use.

#Verification and debugging

To verify that your segmentation code is working as intended, you can inspect the raw pageview events that are sent to

Within the “Query String Parameters” section of the pageview request, you'll want to verify that the data property contains the correct value given your current segmentation status (whether signed-in, registered as a subscriber, etc.). Alternatively, you can also access that field by typing into the developer console.

It's worth testing each scenario that your business logic should handle, including the case when the custom data is not available.

Once you've made the integration changes to send custom data and verified the requests as described above, notify to enable the segments in your dashboard.

Ready to get started with



rocket emoji