In our continuing blog series on the new Google Analytics 4 platform (GA4), we now take a look at how to filter internal traffic. This is a common technique in Universal Analytics (UA) and can be an important way to exclude visits to a business’s website by its employees or sub-contractors, which can skew user data. So how does it work in the new reports?
One of the key differences in GA4 compared to Universal Analytics is that Views are no longer available. These Views could be used in UA to apply filters to some reports, and in many cases, these were used to filter out internal user traffic by IP address, so that reports only showed activity for genuine visitors, rather than potentially the regular users from within a business.
Since the option of using multiple views is no longer part of GA4, the removal of internal users can still be done but it requires a different approach and some additional considerations.
Create Internal Traffic Rules
The method of filtering out internal user traffic from GA4 is by firstly creating a rule in the website data stream that defines the IP address or range of IP addresses that represent internal traffic. You can easily find this by searching for ‘whats my ip’ on Google from different workstations in a business, or check with your IT department.
To do this, go the Admin in your GA4 property, then select Data Streams and the website you are tracking. Once in the Web Stream Details, select Configure Tag Settings, click the Show All link and you will see an option for Define Internal Traffic. You can then create one or more Rules based on your IP details that you want to filter out of your reports.
Applying Filters
Once the internal traffic rules have been defined, these can then be used to set the traffic_type parameter, which can be used in the report filters to include or exclude internal traffic. When a definition of internal traffic is created, the traffic_type parameter is automatically added to all events and has the parameter value that’s specified.
To apply a filter for this internal traffic, you then need to select Data Settings in the Admin menu, and Data Filters. An Internal Traffic filter is automatically generated with a new GA4 property, but this won’t be applied until the IP address rule has been created, or the filter state is changed from Testing to Active.
In the Testing state, GA4 is evaluating the filter but not applying permanent changes, and matching data is identified with the a dimension name and value related to the filter name. If Active state is then selected, GA4 evaluates the filter and applies permanent changes so that data is excluded from reports. If the Inactive state is chosen, GA4 will not evaluate or action the filter.
Use Filters With Care
Things to note are that there are currently two types of data filters: internal traffic and developer traffic. You can create up to 10 filters per Google Analytics 4 property and filters are evaluated from the point of creation forward, and do not affect historical data. Most importantly, once you apply a filter, the effect on the data is permanent, so for example, if you apply an exclude filter, that data is never processed and will never be available in Analytics. There is more information about this here.
If you’ve been using internal IP filters in UA, you can create the rules in GA4 for the same IP address/es but we’d recommend you test them first as a filter. The filtered data will be available throughout the GA4 interface in dimension pickers (e.g., in Reporting and Exploration) so you can view that data to validate your filters before deciding whether to activate them. The main difference to UA is that filters are ‘all or nothing’ and once you apply you can’t check another View to see what tracking variances are being created by a filter.
So it’s best to test your filters before activating them. As always in Analytics, filtering is a destructive operation, so once you start to filter data, it’s gone – forever! At this stage we would therefore recommend setting the rules and a filter but in test mode only and then apply the dimension to reports when needed.
If you want to know more about how filtering out internal traffic can improve the accuracy of GA4 reports and help you gain better business insights, please contact us.