Filter clauses limit the results to some subset of the query based on user-level parameters. Filters allow us to ask questions like "How many visitors per day are referred from Facebook?" or "How many Australian visitors sign up each week?".
Click the "Filter" button in any Heap report in order to add filters. Most Filters have three parts, seen below:
Here's what they all mean:
- The Property represents a user, session, or event-level property that we want to filter on. Examples include referrer, browser, country, or path (the path of a pageview event).
- The Value represents a text string or numerical value we want to match against.
- The Condition represents how we want to match up the Property and the Value. The example above filters our report to countries other than the United States. Other examples of conditions are equals, contains, or greater than.
Let's go through another example. To see how many times user profile pages are being viewed, we might use the filter shown below. The "wildcard matches" condition means that the
* symbol can stand in for any text string. So the
/user/*/profile path can stand in for paths like
You can combine filters with
OR by clicking the Filter button multiple times, or even specify sub-filters by hitting the + button that shows up to the right of each Filter clause. Here's how we would generate a graph of pageviews on your "login" or "welcome" pages by users using Chrome:
The best part of Heap's filters, however, is the ability to include aggregated values in filters, not just object properties. To better understand why users bounce from your landing page, you may want to view users who have visited exactly one page (and never returned). We can run:
The ability to include aggregations in filters opens up some exciting possibilities.