Google Analytics: How to exclude internal traffic 1/3

Method No. 1 – Exclude internal traffic by IP address (We recommend doing this via a web agency)

In this article, you will learn the various steps involved in excluding internal traffic using an IP address

⦁ Step 1. Define your internal IP addresses

In Google Analytics 4. Go to Admin > Data Feeds and select your website’s feed.

Then click on ‘Markup options’:

Select "Define internal traffic". Here, you can create new internal traffic rules. If you are working with multiple IP addresses, you can create separate rules for each IP address.

To keep things simple, you can always enter «internal» in the traffic_type value field. Then, you’ll only need to have a single internal traffic filter in your GA property’s data settings.

⦁ Step 2. Create a developer filter in GA4

In GA4, go to Admin > Data Settings > Data Filters > Create a filter and select "Developer Traffic".

You can enter any name in the «Data filter name» field. Set this filter to ‘Test’ (for now). Save it.

⦁ Step 3. Create a lookup table in GTM to replace the ‘traffic_type’ parameter

GA4 automatically adds a parameter tt = internal (traffic_type) to all requests if they originate from one of your internal IP addresses.

Start by creating an undefined variable. In GTM, go to Variables > New > Undefined and save the variable (you can simply call it ‘Undefined’).

Now go to Variables > Customise (in the Built-in Variables section) and enable the Debug Mode variable.

Here, we use the «Debug Mode» variable as an input. If GTM Preview Mode is enabled, this variable will return ‘true’; consequently, the lookup table variable will return the word ‘developer’. If GTM Preview Mode is not in use, the Debug Mode variable will return ‘false’; consequently, we will return ‘undefined’. This is why we have created the ‘Undefined’ variable. Save the variable.

Finally, go to your Google Analytics 4 configuration tag and enter the following parameter: traffic_type. Its value should be the search table you have just created.

⦁ Step 4. Test the filters

Now it’s time to test it. Enable GTM’s preview mode. Then go to your website. Open the GA4 DebugView.

Firstly, you should always see calls originating from your device. Click on any event in the event stream and check the `traffic_type` parameter. Its value should be ‘developer’.

Furthermore, in the same event, you should also see the ‘Debug Mode’ setting.

⦁ Step 5. Enable both filters

The final step is to enable both filters. Go to Admin (in GA) > Data settings > Data filters and set both triggers (internal traffic and developer traffic) to ‘On’. You can do this by opening each filter, changing its status, and then saving the changes.

Now, try the test again. Browse using the IP address defined as internal.

Disable GTM preview mode. Browse your website (to send certain events to GA4).

Check DebugView. You shouldn’t be able to find your device or see the new events it generates.

Now enable GTM’s preview mode. Browse the website again. Check DebugView. You should now be able to find your device and start seeing data.

Created by Vaniseo – Your Marseille web agency

Contact us

Our team will get back to you within 24 hours

Fancy finding out how much each channel brings in?

Google Analytics 4, conversions, dashboards: we make your figures easy to understand.