Excluding internal traffic is one of the most commonly used admin functionality in Google Analytics.
Unlike Univeral Analytics (version prior to Google Analytics 4), this feature is not available in the usual place in Google Analytics 4. In Google Analytics 4, not only the data model is different but also the interface has completely changed as well. As a result, is hard to find some of the features/functionalities that you might be used to in Universal Analytics. Don't worry, we got you covered. We will be sharing tips and tricks about Google Analytics 4 in various posts.
In this post, I will show you how you can set up an IP filter in Google Analytics 4. If you do need help with setup then don't hesitate to contact us.
How to set up the IP filter for excluding internal traffic
There are several steps to set up IP address filtering in Google Analytics 4.
Step 1: Define the IP addresses that you need to filter or exclude
- Go to Admin Section of the Google Analytics 4 property
- Click on the Data Streams option in the admin section
- Click the data stream that you want to add the IP filter for
- Scroll down and click on "More Tagging Settings" in the "Additional Settings" section on this page
- Select ‘Define Internal Traffic’
- On the next screen click on the "Create" button to create an internal traffic rule.
- Set the configuration settings:
Rule name – Provide a name to the set of IPs that are being set in this rule e.g. Corporate HQ in Seattle
traffic_type value – Set a unique value to be used as an event parameter, e.g. internal, vendors, etc. This value will be used later when you create the filter.
IP address - Set the Match Type and Value to match.
Click on the "Create" button to save the rule.
- Repeat steps 6 and 7 above to add more IP addresses
Step 2: Create the Exclude IP Filter
In the previous steps, you defined the IP addresses and gave them an "event parameter". Now you have to define your IP filters that will make use of those events parameters.
- Go back to the Admin panel of the property
- Click on Data Settings to expand the section
- Click on the Data Filters option
- Click on the "Create Filter" button
- Click on Internal Traffic to define the IP filter
- Set the configuration settings:
- Data Filter Name - Provide a name for the filter
- Filter Operation – select ‘Exclude’ from the drop-down
- Filter events with the following parameter value - Enter the parameter value that you set in traffic_type e.g. internal)
- Filter State - Select testing first, this will allow you to test the filter. Once you are satisfied change to "Active"
Step 3: Test the IP Filter
Now your configuration is done and you are ready to test the filter.
- Go to "Realtime" reports
- Click on "Add Comparison" next to "All users" on the top of the report. This will open up a panel called "Build comparison" on your right hand side.
- Click on “Exclude” in the drop-down.
- In the Dimension drawdown, select "Test data filter name"
- Dimension Value - Select the filter(s) that you created above
- Click on "OK"
- Click on "Apply" to apply that filter to your report.
- Now you will see two data sets "All Users" and "Test data filter name excludes internal traffic"
- Visit your site from the IP address that you excluded and your visit should now be excluded. So your "All users" numbers will be higher than the "Test data filter name excludes internal traffic" numbers.
Step 4: Make the Filter "Active"
Once you are satisfied with the filter, go back to the filter and change the filter state to "Active"
Other Google Analytics 4 post that you might be interested in
- What is Google Analytics 4 (GA4)?
- 10 Key Things to Know Before Upgrading to Google Analytics 4
- Bounce Rate in Google Analytics 4
Need Help with Google Analytics 4?
We provide Google Analytics 4 consulting and training services. We can set up Google Analytics 4 as well as train your team to be self-sufficient. Contact us for a no-obligation consultation.