Google Analytics Filters allow you to control which data is included (as well as excluded) in your reports. Once applied they'll continue to be applied each time the Report API is called to fetch reports.
The most common filter that people create is a filter to exclude internal traffic from showing inside Google Analytics(GA). This is where you remove your own visits so that you have a cleaner, more accurate data in your reports.
How to create filters?
While creating the pipeline with Google Analytics as the source, you can select Advanced Options to configure the Metric Filters and Dimensions Filters. Click on Add New Metric Clause or Add New Dimension Clause to add a Metric filter or Dimension filter respectively. These filters provide greater flexibility with options like:
- Include/Exclude data
- Inequality expressions (Exact Match/ Partial Match/ Begin with/ Ends with etc.)
- Case sensitivity
You can also create and apply multiple filters while configuring. However, the order you apply multiple filters matters. We'll take an example where we'll put dimension filter on dimension pagePath. We want to include all path with /blog and /articles. So, we create two filters: Include /blog and Include /articles. These filters are applied in cascading order and GA will compare pagePath with /blog first and then with /articles. If they are applied in opposite order, it would result in zero results.
Hevo recommends you test these filters using Query Explorer if you're just getting started with filters.
General Use Cases where GA filters come in handy.
- Exclude Internal IP/Traffic.
- To ensure Data Accuracy include specific hostname.
- Include a device category.
- Include a Country.