In Google Analytics 4 (GA4), you can include or exclude certain event data via a feature called ‘Data Filters’:

Filter<data filters

The data filters are configured at the property level. These filters are applied to the event data from the date of creation and do not work retroactively. Since the data filters do not work retroactively, once you apply the filter the effect on your event data is permanent and can not be reversed.

Unlike, Universal Analytics there is no concept of views in GA4. So unlike Universal Analytics, you can not create a raw data view (unfiltered view) in GA4. This makes testing your filters in GA4 much more important than in GA3.

Note: You can create up to 10 filters per GA4 property.

The types of filters in GA4

Currently, GA4 supports two types of filters:

  1. Developer Traffic
  2. Internal Traffic
Types of filters

Internal traffic

Internal traffic is the traffic coming to your website from your own employees, suppliers, and other service providers.

These people are not your target market and therefore the traffic they generate should be excluded from being recorded in your GA4 reports. Otherwise, such traffic can easily skew your analytics data and reports.

By default, GA4 defines internal traffic as the event data with the parameter name ‘traffic_type‘ and parameter value ‘internal’

Internal traffic

You can not change the parameter name but you can change the parameter value if you want to create a different version of the internal traffic filter:

Internal filter<parameter value

You would need to create a different version of the internal traffic filter, in case you need to apply multiple internal traffic filters to your GA4 property:

Internal filters<data filter

The filter which is used to include or exclude internal traffic in GA4 property is called the ‘Internal Traffic filter‘.

Developer traffic

Developer traffic is generated from your own device while debugging the analytics implementation.

GA4 defines developer traffic as the event data with the parameter name ‘debug_mode‘ or ‘debug_event’ and parameter value ‘1’

The filter which is used to include or exclude developer traffic in GA4 property is called the ‘Developer Traffic filter‘.

If you exclude developer traffic using filters, you won’t be able to see that data in real-time reporting since it is excluded.

But you can still see the excluded developers traffic data in the DebugView report and you can still validate your implementation using the Google Analytics Debugger Chrome extension.

Data Filter operations in GA4

Data filters in GA4 can be further classified into include and exclude filters depending upon the filter operation being used:

Data Filter operations in GA4

In GA4 you can carry out two types of operations with data filters:

#1 Exclude: When you use the ‘Exclude’ option, GA4 will not process any event data that matches the filter attribute (in our case ‘traffic_type = internal‘):

Data Filter operations in GA4<Exclude

#2 Include only: When you use the ‘Include only’ option, GA4 will process only that event data that matches the filter attribute (in our case ‘traffic_type = internal‘):

Data Filter operations in GA4<Include only:

Note(1): If you apply both include and exclude filters to your GA4 property then the include filters will be evaluated first before the exclude filter.

Note(2): If you apply multiple include filters to your GA4 property then all the include filters will be evaluated as a single group.

Note(3): If you apply multiple exclude filters to your GA4 property then each exclude filter will be evaluated one at a time.

Filter modes (states) in GA4

Filter modes (states) in GA4

Every GA4 Data filter has one of the three states (modes):

  1. Testing
  2. Active
  3. Inactive

Testing state

Use this option if you want to first test your filter before making it active (i.e. live). When a data filter is in the testing state, it is evaluated by GA4 but it does not make any permanent changes to your analytics data.

However, you can see the filtered data by adding a comparison to your GA4 report that uses the dimension named ‘Test data filter name‘:

Testing state

Active State

Use this option if you want to make your data filter live. Once your data filter is active, it starts making permanent changes to your analytics data.

Inactive State

Use this option if you want to disable your data filter. Once your data filter is inactive, it is no longer evaluated by GA4 and it no longer makes permanent changes to your analytics data.

Leave a Reply

Your email address will not be published. Required fields are marked *