Page 1 of 1

GTM and Google Analytics 4 (GA4): How to filter your internal traffic

Posted: Sun Dec 22, 2024 10:14 am
by Abdur11
If you've already looked into GA4 a bit , you'll have discovered (to your surprise and nightmare) that many things have changed. The negative part comes from our typical resistance to change after so many years; but as always, changes are usually for the better, no matter how many negative opinions you find on the Internet (there are negative things that will surely emerge).




One of the aspects that changes substantially is the filtering of internal traffic.

Now you manage the possible filter types in the Data Filters section:



Internal traffic : all internal traffic that you want to filter. Important: this will not appear in the Debug View option, which will make it difficult for you to manage it in Google Tag Manager. The default value is thailand telegram “internal” and is stored in the traffic_type field, but you can configure other values ​​as well if you want to record differentiated internal traffic. This internal value can be defined directly from GTM; or, if it enters “undefined” and corresponds to an IP defined as internal, Google Analytics will add it.
Developer traffic : this option excludes traffic and categorizes it as development traffic, the advantage (which we will also use in this tutorial) is that its traffic appears in the debug view section . It will be included in this type of traffic, as long as it has debug_mode=1 or debug_event=1. Something that is present without you doing anything when using the preview, for example, from Google Tag Manager.

Image

Ways to manage filtering

Using GTM and GA4, we have several options for filtering traffic. Some you can do yourself and others will require intervention from your development team:



Filtering in GA4 by defining IPs : We have already mentioned that one of the types of traffic is internal traffic. To filter it, you can enter the IPs you want to filter in the corresponding Data Stream. We will explain this in more detail later, but basically you just have to enter your IPs to filter there.
In GTM using a datalayer: here it is a matter of including development to print a datalayer when the traffic is internal, in which case you will have to pass the variable traffic_type=internal. It allows you to be more flexible regarding traffic that may not be just by IP, such as for a validation, a page visited, etc.
GTM and Cookie: In this case, it also requires development. If, for example, internal traffic is determined on a specific URL, you can do this directly in GTM with javascript. The cookie is kept for the time you define, so it has that advantage if you need it: that user can continue to be considered internal, even if they browse with another IP.


Excluding internal traffic using IP filters

In this tutorial we are going to cover this type of filtering, and how to solve the main problem of being hidden in the Debug View.