Ever since we started using Google Analytics –or any similar tool- getting the cleanest, highest-quality data possible has been an obsession for many analysts.
And of course, one of the biggest sources of spurious data is what we generate ourselves when we access the website.
Logically, if we include our own actions as if we were just another user, our behavior will affect metrics such as bounce rate or conversion rate.
Generally, on small projects we can live with this, but on medium or large ones things change.
The problem with internal traffic in Analytics
If we have a Customer Service department –as at TiendAnimal or Yo pongo el hielo- or even an entire Call Center -as at Lowi- they may use the same systems (the same website) to register or place customer orders as regular users do.
It's a good way to achieve the much-talked-about omnichannel approach.
The thing is, as you can imagine, if they use the same website, it is very likely to include the same Analytics tracking.
The data from Customer Service agents will then be mixed with that of regular users.
That said, it seems obvious that this data will not be the best for analyzing the behavior of standard users who have no direct relationship with the business.
Because, for example, each agent's conversion rate will exceed 100%, while that of the user group we want to analyze will, with luck, be around 2%.
You see the problem with mixing the data from both groups, right?
And that is why Universal Analytics included the option to filter this data –called internal traffic-.
Or even to have two separate properties, one for each type of data.
Google Analytics 4 also includes the option to filter it.
The thing is that the way you do it has changed.
A lot.
And that's why I'm going to explain how to do it in this article.
Tutorial: how to filter internal traffic
The process basically has two steps in the GA4 configuration and another on the front end, which also lets us check that everything works as expected.
In total, about ten minutes.
Mind you, you need a fixed IP for it to work. If you don't have one, you'll need a custom development to filter this traffic.
(Or use a little trick I'll mention when I talk about remote work).
#1. Find out the IP address
As I said, you need one (or more) fixed IPs for internal traffic filtering to work, because Analytics is going to filter internal traffic by its IP.
So the first thing is to find out the IP you want to filter. The one that will define internal traffic.
To do this, you can go to a website such as https://www.cualesmiip.com/ or any other one you trust that will tell you:

Copy that IP; we'll need it next.
#2. Define our IP as internal traffic
The first thing is to select the correct data stream.
To do this, go to Admin > Data streams and select the one you want. Click “Configure tag settings”:

Once inside, click “Show all” in the settings section.
Several more options will appear, including “Define internal traffic”. Click it:

When we enter, if this is the first time, we won't have any rules created, so click the “Create” button to add the first one.
We'll create it like this:

Where:
- Rule name: I recommend using the name of the physical location.
- Valor_traffic_type: leave “internal” unless you have a good reason not to.
- IP address: if there is only one, you can choose the “equals” match type and paste the IP from the previous step.
Save.
With this, we've identified our IP (77.243.86.89 in the example) and assigned it the value “internal”.
Keep that in mind.
#3. Create the data filter
Now, under Admin, go to Data settings > Data filters.
Oh, surprise!
We already have an internal traffic filter created:

GA4 creates it automatically, so click it to edit it.
Leave it like this:

Here we need to set:
- Data filter name: the value the parameter will later take in the reports. Choose whatever descriptive name you want.
- Filter operation: “Exclude” (although, as we'll see, later we can exclude or include it in reports).
- Parameter value: earlier we left it as “internal”. If you changed that name, enter yours here.
- Filter state: “Testing”. Unless you've tested everything, know that it works as expected and are absolutely sure you want to exclude traffic from this IP. Leaving it in testing lets us view reports including or excluding internal traffic. Depending on the project, this can be useful.
Save the changes.
#4. Test that everything works
Now we'll go to the default Traffic acquisition report and look at the overall Users or Sessions and Conversions data.
Click "Add comparison":

I create a comparison like this:

The fields are:
- Parameter: “Test data filter name” (tip: type “test” in the input so it appears).
- Match type: “Exactly matches”.
- Value: a dropdown will appear with the name you gave it. Select it.
Apply.
The report will show a new segment with the internal traffic for the period:

If we've done everything correctly and choose a one-day period, there should be roughly the same number of users in GA4 as computers or employee devices accessing the website.
From here, if the data makes sense, we can use the internal traffic filter.
Or not.
Depending on what suits us.
Filter with multiple locations and IPs
A quick aside before we see how to use the filter.
If we had several internal IPs, for example because the offices and call center are separate and we want to filter traffic from both, we can do two things:
- Repeat the entire process with the IPs for each one, so that we have several internal traffic types.
- Use a regular expression when adding the IP, so that we group together traffic from different physical locations.
Whichever you prefer.
How to use the internal traffic filter in Google Analytics 4
So, if the data matches up when we create the comparison, we can now filter this internal traffic using the filters in GA4 reports.
Click Add filter and use the same values we just entered to create the comparison, except for one:

Logically, if we want to exclude this traffic, we'll have to specify “Does not exactly match”.
Everything else stays the same.
As you can see here, and if you remember the figures from before (you can look at the images above), you can see that it is applied correctly:

How it works technically
If you're an analytics and Google Analytics geek, I'll tell you that what we've done with this whole process is this:

Tell GA4 to classify traffic from that IP as “internal”, so that we can filter it in the reports.
You can see this result as a parameter of the pageview event in GA4 DebugView.
Use cases for the internal traffic filter
After understanding the problem caused by mixing both types of traffic and explaining how to avoid it, I'd like to add a few cases where it makes sense to consider using this type of filter.
I'll tell you about them after the ads.
Customer Service and Call Center
The most common case has already been mentioned: the Customer Service team or Call Center, because it will send certain metrics, such as conversion rate, through the roof.
It's clear that in certain reports, such as Landing pages, we don't need internal traffic.
It gives us misleading information about our users' behavior and therefore needs to be filtered out.
But, on the other hand, we may well want to collect all the data in our GA4 property for Ecommerce, with the website's transactions and revenue. Including those from the Call Center, because in the end, a customer calling to place an order by phone is simply another channel.
And we'll want to see what they bought and how much they spent.
That's why, if we leave the Testing option when configuring internal traffic, we can show or hide the data we are interested in depending on the report. Filtering when it suits us and not filtering when it doesn't.
There are other, more elaborate solutions based on the same idea: we can configure different data streams depending on the type of traffic. It's a bit more complex, but it can be done easily with GTM.
Then I would use the Stream name filter to decide which data I see and which I don't.
Development team or digital marketing agency
Similarly, I might want to filter traffic to the website from the development team –mainly- or from the digital marketing agency -to a lesser extent- as they will have to run tests with pixels, campaigns and transactions.
Speaking of development, perhaps you're adding data from your local or pre-production environments …to the same stream… Review it and move them to another stream, filter them or exclude them. This last option shouldn't be difficult by adding the debug parameter with the value _dgb = 1.
Remember that we're looking for the cleanest data possible.
Remote work
It's more complicated to filter traffic from employees working on their laptops from their own homes, Starbucks or camper vans.
In this case we couldn't use the IP filter solution and it isn't necessarily “debuggable” traffic.
There is a solution too, but it requires a full tutorial that I may get around to writing at some point.
That's if you want to do it properly; you can always give them a tagged URL like this:
https://miweb.com?utm_source=teletrabajo&utm_medium=internal
And then exclude the source/medium “teletrabajo / internal” from reports, for example.
The point is to be a little imaginative with this.
Conclusions
As I hope I've made clear, filtering internal traffic offers quite a few options in GA4 and is done differently than in Universal.
The actual implementation isn't difficult.
What's harder is deciding which reports you want to apply it to and which you don't.
Or whether you prefer to have several different streams.
In the end, you define the structure of your GA4 property and, depending on your preferences, it may suit you better to filter internal traffic directly, or keep it and use different streams and filters.
In any case, give some thought to what extra data you're collecting that you don't need and how you can avoid it.
Ultimately, more precise data always makes it easier to make better decisions.


Leave a Reply