Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Popular on Amazon
Sale
TP-Link ER605, Wired Gigabit VPN Router | Up to 3 WAN Ethernet Ports + 1 USB WAN, SPI Firewall SMB Router, Omada SDN Integrated, Load Balance, Lightning Protection
  • 【Five Gigabit Ports】1 Gigabit WAN Port plus 2 Gigabit WAN/LAN Ports plus 2 Gigabit LAN Port. Up to 3 WAN ports optimize bandwidth usage through one device.
  • 【One USB WAN Port】Mobile broadband via 4G/3G modem is supported for WAN backup by connecting to the USB port. For complete list of compatible 4G/3G modems, please visit TP-Link website.
  • 【Abundant Security Features】Advanced firewall policies, DoS defense, IP/MAC/URL filtering, speed test and more security functions protect your network and data.
  • 【Highly Secure VPN】Supports up to 20× LAN-to-LAN IPsec, 16× OpenVPN, 16× L2TP, and 16× PPTP VPN connections.
  • Security - SPI Firewall, VPN Pass through, FTP/H.323/PPTP/SIP/IPsec ALG, DoS Defence, Ping of Death and Local Management. Standards and Protocols IEEE 802.3, 802.3u, 802.3ab, IEEE 802.3x, IEEE 802.1q

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

Also popular on Amazon
Capri CP-EL128, Server & 2 Travel Router VPN – Secure Home Network Access from Anywhere, Keep Your Home IP Wherever You are, and Enjoy Private, Full VPN Control
  • Secure Remote Work for Two : Includes two travel routers, so a colleague or family member can also connect remotely.
  • Work from Anywhere Securely : Connect to your home network with a VPN travel router designed for remote professionals.
  • An active KeepYourHomeIP : subscription is required for the VPN setup to work. One month of free subscription is included with the VPN package.
  • Seamless Remote Work : Connect multiple devices simultaneously, including laptops, tablets, and phones.
  • Bypass Geo-Restrictions : Both users can access home services, streaming, and work apps securely from anywhere.
  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.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

Also popular on Amazon
Sale
Cudy Gigabit Multi-WAN Router, OpenWRT, Load Balance, 5x GbE, R700 | OpenWRT-ready Multi-WAN tunnel gateway, 5x GbE ports, WireGuard/OpenVPN/IPsec, traffic Balancing, Failover, VLAN, QoS
  • Multi-WAN Business Continuity: Connect up to 5 ISPs with automatic failover and load balancing — if one connection drops, traffic instantly reroutes to keep your business, remote office, or home lab online
  • OpenWRT-Ready Enterprise Control: Full OpenWRT support unlocks VLAN segmentation, advanced firewall rules, custom QoS policies, and community-developed packages for professional-grade network management
  • Complete VPN Gateway Suite: WireGuard, OpenVPN, IPsec, PPTP, and L2TP server and client built in; create site-to-site tunnels, host remote access, or route specific VLANs through encrypted VPN connections
  • Professional Security Stack: SPI firewall, DoS attack prevention, IP/MAC binding, domain filtering, and DMZ hosting protect your network perimeter while keeping critical services accessible
  • Flexible Deployment & Monitoring: Web GUI or Cudy App cloud management with TR-069 support; built-in diagnostic tools (Ping, Traceroute, NSLookup, system logs) for rapid troubleshooting anytime
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)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Also popular on Amazon
Sale
TP-Link ER7206, Multi-WAN Professional Wired Gigabit VPN Router | Increased Network Capacity, SPI Firewall, Omada SDN Integrated, Load Balance, Lightning Protection
  • 【Flexible Port Configuration】1 Gigabit SFP WAN Port + 1 Gigabit WAN Port + 2 Gigabit WAN/LAN Ports plus1 Gigabit LAN Port. Up to four WAN ports optimize bandwidth usage through one device.
  • 【Increased Network Capacity】Maximum number of associated client devices – 150,000. Maximum number of clients – Up to 700.
  • 【Integrated into Omada SDN】Omada’s Software Defined Networking (SDN) platform integrates network devices including gateways, access points & switches with multiple control options offered – Omada Hardware controller, Omada Software Controller or Omada cloud-based controller(Contact TP-Link for Cloud-Based Controller Plan Details). Standalone mode also applies.
  • 【Cloud Access】Remote Cloud access and Omada app brings centralized cloud management of the whole network from different sites—all controlled from a single interface anywhere, anytime.
  • 【SDN Compatibility】For SDN usage, make sure your devices/controllers are either equipped with or can be upgraded to SDN version. SDN controllers work only with SDN Gateways, Access Points & Switches. Non-SDN controllers work only with non-SDN APs. For devices that are compatible with SDN firmware, please visit TP-Link website.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.