Starting from August 4, 2023, GA4 has introduced a new capability for report filters, which enables you to apply additional filter types, including new match types like regex (regular expressions).
Report filters in GA4 can be applied at the property level, which implies that these filters affect all data streams within a single property. This allows you to customize your Google Analytics 4 reports by adding filters. Initially, filter operations were focused on excluding or including events and parameters.
However, with the recent enhancements, report filtering now support a range of options including exact matches, partial matches, and even regular expressions (regex).
Where to Find Report Filters?
Filters can be applied to various detailed reports, including pages and screens, landing pages, events, and e-commerce purchases reports. The "add filter" option is not available in overview reports. This filtering option is located above the charts.
Upon clicking "add filter," you can implement multiple filters, allowing you to focus on specific dimensions such as regions, custom events, and traffic sources.
How to Use New Match Types in GA4?
The new match-type filters provide you with the following data filtering options:
- Exact Matches
- Partial Matches
- Regex (Regular Expressions)
Let's illustrate each of these with examples.
Exact Matches
Exact match filters shows data that either matches or doesn't match specific dimension values. You can select match type as:
- exactly matches
- does not exactly match
For example, by using exact match filters, you can display data from United States or Canada excluding any other countries. Upon selecting multiple dimension values (in this case, countries), the data shown will precisely match either US or Canada.
Partial Matches
Partial matches are enhanced filters that enable the filtering of dimension values using:
- contains
- begins with
- ends with
- does not contain
- does not begin with
- does not end with
For example, you can identify specific landing pages using the "begins with" filter, which will display only those landing pages that initiate with specific URLs.
Regular Expressions (Regex)
Regular expressions (regex) enable you to establish more advanced filters for matching dimension values according to specific patterns or criteria.
In GA4, regular expressions are precise sequences of characters that can broadly or precisely match patterns within your data. You can create regex filters using:
- matches regex
- matches partial regex
- does not match regex
- does not match partial regex
For example, instead of utilizing the "or" operator, you can use "United States|Canada" in order to get only data from these two countries.
Please review Google's article to learn more about the characteristics of regular expressions (regex) .
Filter Conditions
Report filters help refine data analysis by setting specific criteria based on dimensions and their values. For example, you can use a filter to focus on device categories like desktop, mobile, tablet, and smart TV.
When you have several values for one condition, the filter follows OR logic, matching any of those values. If you have multiple conditions in a filter, it uses AND logic, requiring all conditions to be met.
Keep in mind that some dimensions can't be excluded from filters due to their importance, while others might be unavailable based on your configuration.