To better understand particular cohorts of users, you can define Segments to bring into your analysis. A segment is any subset of your users: "Active Users," "Canadian Visitors," "Frequent Buyers," and "People who signed up in January" are all examples of segments.

Creating Segments

To create your first Segment, navigate to Define > Segments within Heap and click the '+ New Segment' button. On the page that appears, define the name, category, and filters for your segment.

A Segment can be defined based on any combination of behavioral actions and user-level properties. For example, you could define a segment called 'Big Spenders' for all users with greater than 10 purchases.

When conducting analysis in report modules later on, you can limit the data to users who are Big Spenders, or directly compare the behavior of Big Spenders to users who do not fall into the segment. You can also directly compare multiple segments, such as the performance of cohorts from particular marketing channels.

Time-bounded Segments

Time-bounded segments are a type of segment that allow you to define a segment in terms of whether a user has done a specific event within the last day, week, or month. This means that the segment's membership changes every day. These type of segments can be graphed using Size of Segment, or used as filters for other queries.

Let's look at an example. You could define an 'Active Users' segment as users who have logged in at least once within the last week.

Size of Segment

The size of a segment is calculated at midnight each day, and if you graph this for the prior 7 days segment using Size of Segment, each day's data point will represent the number of users who logged in at least once in the past 7 days leading to that point. In prior day, it's the past 24 hours.


The segment's behavior changes when used as a filter. Unlike the above example, in a prior 7 days segment, a filter is applied to the event being analyzed, and is calculated as the prior 7 x 24 hours (168 hours) from the moment that the query is run. So, running a query for the Count of Sessions in the past month, filtered by users in our Active User segment is the same as saying, "Of all the users who have logged in at least once in the past 168 hours from now, show me the sessions they had each day in the past month".

Deleting Segments

To delete a segment, from the Define > Segments page, click the segment to open up the event details, then click the trashcan icon in the top-right.

To delete multiple segments at once, from the segments tab, open the category of the segments, click the checkbox next to the segments, then click the trashcan icon next to "x segments selected".

Updated 3 months ago


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.