Using Google Analytics 4 help you keep track of your own traffic, interactions, and events as well as those generated by your own marketing, development, or founding teams. You wouldn’t want to artificially exaggerate your website interactions and skew your website data because many people might be working on it every day!
As a result, it’s crucial to exclude internal traffic from your GA4 report.
In this blog, we will provide you the two methods that help you Exclude Internal Traffic in GA4 account. Continue Reading!
First Method- Exclude Traffic By IP Address
If there aren’t many people involved in running the business and you can quickly filter out their hits based on their IP addresses, this method might work. If you need to enter a lot of different IP addresses or certain IP addresses are not static, this method does not function effectively.
Here are the steps to follow!
Step 1- You have to define your internal IP address.
Go to Admin > Data Streams and then select your website stream.
Select “Configure Tab Settings” option.
Click on the show all option and select “Define internal traffic” option to create new internal traffic rules.
If you are using numerous IPs, you can make separate rules for each IP. We hope regular expressions will also be supported here in the future.
To make things simpler, you may always write “internal” in the traffic_type value column. Then, just one Internal Traffic filter in your GA property’s Data Settings will be sufficient.
in case, you don’t know your IP, click on the “Whats my IP Address?” option.
Step 2- Make a Developer Filter in GA4
Go to Admin > Data Settings > Data Filters > Create Filter in Google Analytics 4. Select Developer Traffic option. Set the following settings:
Step 3- In order to override the traffic_type parameter, create a lookup table in GTM.
Make an Undefined variable first. Go to Variables > New > Undefined in GTM to create the variable, which can have the name Undefined as a suffix.
Enable the Debug Mode variable by going to Variables > Configure (in the Built-in variables section).
Go to Variables > New > Lookup Table and provide the following settings:
The Debug Mode variable is being used as input. This variable will return true if the GTM preview mode is on. The word “developer” will thus be returned by the lookup table variable. Whenever GTM Preview mode is not used, the Debug Mode variable will return false. We shall therefore return undefined. We made the undefined variable as a result.
Now save the variable.
Enter the parameter traffic_type in your Google Analytics 4 setup tag by going there. And the lookup table you just made should be its value.
Step 4- Now Test the Filters
Activate the GTM preview mode. Go to your website by using the IP address that is specified in the Internal Traffic section of your Data Stream. Go to the DebugView of GA4.
You should continue to receive hits on your device. In the event stream, click any event, then look at the traffic_type parameter. It should have developer value.
You should also see the Debug Mode parameter in the same event.
Remember that neither the developer nor the internal filters are presently activated. The soon-to-be-excluded data is still accessible in the standard GA reports because they are in testing mode.
Filters are given a new dimension called Test data filter name while they are in testing mode. It can be used to examine how much of the data would have been omitted if the filters had been in effect as a secondary dimension (or in Analysis Hub).
Step 5- Enable Both Filters
Go to Admin (in GA) > Data Settings > Data Filters and enable both the internal traffic and developer traffic triggers active.
Read More: How to Monitor Website SEO Performances in Looker Studio
Second Method- Exclude Traffic by Data Layer
Step 1- Including the Internal Data Parameter in the Data Layer
If it is possible, you should request that the developer add the user_type (or traffic_type, or whatever) option to the data layer so you can tell whether a visitor or user is an employee of your business. The parameter’s value should be internal if the visitor is an employee of your business. No dataLayer.push should occur if a user or visitor does not work for your firm.
If the user or visitor is a client of your business, your developer might activate the following sample dataLayer.push code:
The event key is not necessary. Before the GTM Container snippet is loaded, this code needs to be activated.
Then make a data layer variable with the following options:
Step 2- Make a Developer Filter in GA4
Go to Admin > Data Settings > Data Filters > Create Filter in Google Analytics 4. Select Developer Traffic option. Set the following settings:
Put Testing as the filter’s current setting. Save it.
Step 3- Create a Lookup Table to Replace the traffic_type Parameter in GTM.
Enter the following settings by selecting Variables > New > Lookup table:
The Debug Mode variable is being used as input. This variable will return true if the GTM preview mode is on. The word “developer” will be returned by the lookup table variable.
The Debug Mode variable will return false if GTM Preview mode is not in use. Since you created the Data Layer Variable in the initial step, we will now return its value.
The value of the traffic_type key will be provided to GA if it is present in the data layer. It will be set to undefined if the key is missing, which means that GA4 won’t provide the traffic_type key at all.
Save the variable.
Enter the parameter traffic_type by going to your Google Analytics 4 configuration tag. And the lookup table you should to be its value.
Step 4- Test The Filters
Follow the same procedure as mentioned above in the first method.
Step 5- Enable Both Filters
Both the internal traffic and developer traffic triggers should be set to active. Go to Admin (in GA) > Data Settings > Data Filters. You can perform by open each filter, modify its Filter state, and then save the adjustments.
Final Words
We hope you find a suitable method to exclude internal traffic from your GA4 account. But also remember the methods mentioned above are not perfect. So always remember this:
- If the IP addresses of your employees are dynamic, IP-based filters won’t function.
- push-based filtering needs developer input and still can miss some employees who browse somewhat anonymously and haven’t logged in anyplace so that your developer might identify them.
If you still have problems while excluding the internal traffic, you have to seek professional help. SEO Singapore is the leading SEO Service provider that helps you exclude internal traffic without any problem. With our expertise and knowledge, we will make sure the process is seamless!