How to Exclude Internal Traffic in Google Analytics 4 (GA4) via IP

Photo of author

By Victor Ashiedu

Published

Do you want to block or exclude internal traffic in Google Analytics 4 (GA4)? This is a smart move, and this guide will teach you how to do that.

Step 1: Get your Public IP Address

The first step to excluding internal traffic in Google Analytics 4 is to determine your public IP address. Follow the steps below to find your IP address.

  1. Click this link to open a Google search that displays your IP address – what is my ip – Google Search
  2. Then, note your public IP address. Google is likely to display your IPv4 address. However, you may also have a public IPv6 address.
  1. Finally, to get both your IPv6 and IPv4 address, open What Is My IP Address – See Your Public Address – IPv4 & IPv6. The website should display your IPv4 and IPv6.

    As you can see from the screenshot below, the site displays my IPv6 address but could not detect my IPv4 address. Fortunatly, I already have my IPv4 from the Google search result.

    Copy both IP addresses as you would need them in the next section.

Step 2: Define your Internal IP Address in Google Analytics 4 (GA4) Data Stream Setting

After you determine your public IP address, the next step to excluding internal traffic in Google Analytics 4 is to define internal traffic in the GA4 Data stream settings.

Follow the steps below to complete this step…

  1. Sign in to your Google Analytics. Then, on the bottom left of Analytics, click Admin.
How To Exclude Internal Traffic In Google Analytics 4 (GA4) Via IP - Step 1: Define Your Internal IP Address In Google Analytics 4 (GA4) Data Stream Setting
  1. When your Google Analytics Admin settings open, select the account that contains this GA4 property in the Account drop-down (1).
  2. Then, in the Property drop-down, select the GA4 property (2). Finally, on Google Analytics 4, click Data Streams.
  1. On the Data Streams page, click on the data stream for the GA4 property you want to edit.
How To Exclude Internal Traffic In Google Analytics 4 (GA4) Via IP - Step 1: Define Your Internal IP Address In Google Analytics 4 (GA4) Data Stream Setting
  1. Then, scroll down to the Google tag section and click “Configure tag settings”.
  1. By default, the Configure tag settings page will open on the “Configuration” (1) tab. Scroll down and on the Settings section, click “Show all”.
  1. Then, scroll down and click Define internal traffic. When the “Internal traffic rules” page opens, click the Create button – see the second screenshot below.
  1. On the Create internal traffic rule page, give the rule a recognizable “Rule name” (1). Then, on the “traffic_type value” rule, enter a name and note it; you’ll require it for the filter you will create in the next section to work.
  2. Proceed to the IP addresses section. Then, on the “Match type” drop-down, select IP address equals (3) – then, enter your public IPv4 in the Value (5) field.
  3. When you finish, to create the rule that defines your internal IP address in Google Analytics 4, click Create (6). Google Analytics will return to the Define internal traffic page.
Create a different internal traffic rule for IPv4 and IPv6. Make sure to give the “traffic_type value” a unique value like internal_traffic_1, internal_traffic_2. In the next section, you’ll create a filter for each rule.
  1. Finally, click the close button on the top left of the Define internal traffic page.

Step 3: Create Filters to Exclude Internal Traffic in Google Analytics 4 (GA4) with the Internal IP Rule

Now that you have identified your internal traffic by creating an internal traffic rule in GA4, it is time to exclude the internal traffic in Google Analytics 4.

To complete this step, you need to create a filter in your GA4 Data Settings. Follow the steps below to complete this task.

  1. While still signed in to your Google Analytics, click Admin on the bottom left (1). Then, ensure that you have selected the right Property (2).
  2. On the property setting, click Data Settings (3). When you click Data Settings, Google Analytics will display three more options beneath Data Settings.
Create Filters To Exclude Internal Traffic In Google Analytics 4 (GA4) With The Internal IP Rule
  1. Then, beneath Data Settings, click Data Filters.
  1. When the Data filters page opens, click “Create Filter.” Then, click Internal traffic – see the second screenshot below.
Create Filters To Exclude Internal Traffic In Google Analytics 4 (GA4) With The Internal IP Rule
  1. Finally, complete the Create data filter page as shown below to create a GA4 filter that excludes your internal traffic.

    The only setting you can change is the Data Filter Name. You MUST also make sure that you set the traffic_type to the same value you set traffic_type to in the last section.

    In this example, my traffic_type is internal_traffic_1.

    When you finish, click Create on the top right of the page.
Warning!
Google warns that filtering is a destructive operation. So, Google strongly recommends that you test your filters before activating them.
Make sure you select Testing in the Filter state section below. Then, proceed to the next section to learn how to test that your filter is working before activating it.
Create Filters To Exclude Internal Traffic In Google Analytics 4 (GA4) With The Internal IP Rule

Google Analytics will create the data filter and display additional steps. In the last section, you selected “Testing” in the Filter state section of the configuration.

Google recommends that you test before you activate the filter. You test first before activating it to be sure that your filter works before you activate it.

In the final section of this guide, you will find the steps to test your rule and then activate it.

Before you move on, create a data filter for each internal traffic IP rule you created in the last section. Remember to use the unique traffic_type in the Parameter value field. See the field I labeled (2) in the screenshot below.
Create Filters To Exclude Internal Traffic In Google Analytics 4 (GA4) With The Internal IP Rule

Step 4: Test and Activate your Internal Traffic GA4 Filter Rule

The last step to exclude internal traffic uin Google Analytics 4 (GA4) is to test that the traffic rule(s) are working as expected. Then, if you’re happy that the rules are working, you activate each data filter rule you created in the last section.

To test the internal traffic rules, follow the steps below:

  1. Visit your website with the device that has the public IP you want to exclude in GA4.
Before you proceed to step 2, you MUST complete step 1. You must visit your site with a device connected to the internal network you want to exclude from GA3
  1. Then, return to Google Analytics. On the left pane, click Reports.
  1. When the Reports dashboard page opens, click Real-time. Then, click Add comparison – see the second screenshot below.
Create Filters To Exclude Internal Traffic In Google Analytics 4 (GA4) With The Internal IP Rule - Step 4: Test And Activate Your Internal Traffic GA4 Filter Rule
  1. Next, on the far right, click the Select dimension drop-down. Then, scroll down to the General section and click Test data filter name – see the second screenshot below.
If the Test data filter name dimension is grayed out it means that either your previous configurations were not done properly or your have not visited your website from the device with the IP address you created a rule to exclude.
Create Filters To Exclude Internal Traffic In Google Analytics 4 (GA4) With The Internal IP Rule - Step 4: Test And Activate Your Internal Traffic GA4 Filter Rule
  1. Finally, click the Select dimension values drop-down, then, click the name of the data filter rule you created in the last section. Finally, click OK and click Apply.
Create Filters To Exclude Internal Traffic In Google Analytics 4 (GA4) With The Internal IP Rule - Step 4: Test And Activate Your Internal Traffic GA4 Filter Rule

Once you create the comparison filter, Google Analytics will display the test data filter (usually in orange). Then, Google Analytics will display the traffic from your device in that orange section.

After confirming that your Google Analytics 4 (GA4) internal traffic exclusion works, proceed to step 6 to activate the filtering rule.

  1. On the bottom left of Google Analytics, click the Admin settings icon.
Create Filters To Exclude Internal Traffic In Google Analytics 4 (GA4) With The Internal IP Rule - Step 4: Test And Activate Your Internal Traffic GA4 Filter Rule
  1. Then, in the Property column, click Data Settings. Next, from the options Analytics displays, click Data Filters.
  1. Next, click on the Data filter you want to activate.
  1. When the Data filter opens, select Active and click Save (top right). Finally, on the confirmation pop-up window, click Activate filter.

Google Analytics will return to the list of Data filters. The current state of the data filter you just activated will display “Active.”

Repeat steps 8 and 9 for all data filters you want to activate. From now on, Google Analytics 4 (GA4) will exclude any internal traffic that meets your defined criteria.

Frequently Asked Questions

1. What is Google Analytics 4 (GA4)?

Google Analytics 4 (GA4) is Google’s latest Analytics version with enhanced features. Here are some of the differences between GA4 and the current Universal Analytics:

i) GA4 uses events instead of session-based data
ii) The new GA4 includes privacy controls such as cookieless measurement and behavioral and conversion modeling
iii) GA4 supports predictive capabilities and offer guidance without complex models

2. How do I block IP addresses on Google Analytics 4?

Follow the steps below to block an IP address on Google Analytics 4

i) Define the IP as an Internal IP address
ii) Create a data filter that excludes the IP
iii) Test the IP traffic filter
iv) If it works, activate the data filter

4. How do I exclude an internal IP address from Google Analytics?

If you use the older Google Analytics (not Ga4), follow the steps below to exclude an internal IP address.

i) On the view column of the Google Analytics property, click Filters
ii) When the Filters page opens, click the ADD FILTER button
iii) Give the filter a name, then select Predefined. Then, on the “Select filter type” drop-down, select Exclude.

On the “Select source or destination” drop-list, select traffic from IP address. Finally, on the “Select expression” drop-down, select that are equal to – then, on the IP address field, enter the IP address you want to exclude and click Save.

4. Why does Google Analytics exclude IP addresses?

If Google Analytics excludes an IP address, it is likely that you defined a filter that excludes that IP address from Google Analytics.

5. Should I use Google Analytics 4?

The simple answer is Yes, you should use Google Analytics 4 (GA4). However, before you switch to GA4, check that any app or service that requires Google Analytics supports GA4.

In any case, you can (and should) set up both versions of GA side-by-side. Then, switch to GA4 later.

It is important to mention that Google will decommission Universal Analytics from July 2023. To read more about what happens when Google decommissions UA, visit Universal Analytics will be going away – Analytics Help (google.com)

Conclusion

If you run a website and use Google Analytics 4 (GA4) to measure your site performance, it is smart to exclude your internal traffic. This is because internal traffic skews your Analytics data.

Furthermore, it is likely that users within your business will spend more time on your website and visit multiple pages. So, for internal traffic, stats like bounce rate and average session duration will be unreasonably larger than usual.

On the other hand, internal users may spend less time on the website. This will also affect the actual site performance data.

All in all, excluding internal traffic or traffic from logged-in users ensures that your analytics data is accurate and reflects real users’ actual behavior.

I hope you were able to use the steps in this guide to exclude internal traffic in Google Analytics 4 (GA4)! If yes, click on “Yes” beside the “Was this page helpful” question below.

You may also express your thoughts and opinions by using the “Leave a Comment” form at the bottom of this page.

Finally, visit our WordPress & Websites How-To page for more articles about WordPress and websites.

About the Author

Photo of author

Victor Ashiedu

Victor is the founder of InfoPress Media, publishers of Ilifeguides and Itechguides. With 20+ years of experience in IT infrastructure, his expertise spans Windows, Linux, and DevOps. Explore his contributions on Itechguides.com for insightful how-to guides and product reviews.

Related Articles

Get in Touch

We're committed to writing accurate content that informs and educates. To learn more, read our Content Writing Policy, Content Review Policy, Anti-plagiarism Policy, and About Us.

However, if this content does not meet your expectations, kindly reach out to us through one of the following means:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

Leave a comment