[UA] Exclude internal traffic [Legacy]

Filter out traffic to your website from people on your corporate network.
You are viewing a legacy article about Universal Analytics. Learn more about Google Analytics 4 replacing Universal Analytics.
This article is about excluding internal traffic in Universal Analytics. For information about excluding internal traffic in Google Analytics 4, go to [GA4] Filter out internal traffic.

Most of the time, Analytics is used to track how external customers and users interact with your website, since internal traffic patterns are typically different from external traffic patterns. When your reporting views contain hit data from both internal and external users of your website, it might become difficult to determine how your customers are actually interacting with your website.

As an example, let's say you have an ecommerce website. Internal traffic might include stress testing that will send a large number of hits to a particular page on your website. Your reports will show a large number of hits on this page and it will be difficult to discern how many hits came from customers and how many hits came from your stress testing.

Create an IP address filter

If your network is IPv6 compatible and you are sending IPv6 addresses to Analytics, then make sure your filter uses the IPv6 format for those addresses.

If you are sending IPv4 addresses, then make sure your filter uses the IPv4 format for those addresses.

To prevent internal traffic from affecting your data, you can use a filter to filter out traffic by IP address.

You can find the public IP address you are currently using by searching "what is my ip address" on google.com. You can find out what IP addresses and subnets your company uses by asking your network administrator.

To create an IP address filter:

  1. Follow the instructions to create a new filter for your view.
  2. Leave the Filter Type as Predefined.
  3. From the Select filter type menu, select Exclude.
  4. From the Select source or destination menu, select traffic from the IP addresses.
  5. From the Select expression menu, select the appropriate expression.
  6. Enter the IP address or a regular expression. See the examples below.

If you have multiple IP addresses or subnets to exclude, you can make more than one filter. As with all filters, make sure the conditions you specify don't interfere with or contradict each other.

Exclude a single IP address

To exclude a single IP address, such as 192.168.0.1, set up the filter like this:

  • Filter name: enter a name
  • Filter type: Predefined
  • Select filter type: Exclude
  • Select source or destination: traffic from the IP addresses
  • Select expression: that are equal to
  • IP address: enter a single IP address

Exclude single IP filter example.

Exclude a subnet of IP addresses

For a subnet of IP addresses like 192.168.0.*, set up the filter like this:

  • Filter name: enter a name
  • Filter type: Predefined
  • Select filter type: Exclude
  • Select source or destination: traffic from the IP addresses
  • Select expression: that begin with
  • IP address: enter the IP address, minus the subnet
Exclude subnet filter example
Exclude IPv6 addresses

IPv6 addresses (which look like 2620:0:10e2:2:c4bc:9fd2:974f:cf19) can be excluded in the same way as standard IPv4 addresses. Here's an example of a subnet exclusion filter in IPv6:

  • Filter name: enter a name
  • Filter type: Predefined
  • Select filter type: Exclude
  • Select source or destination: traffic from the IP addresses
  • Select expression: that begin with
  • IP address: enter the IPv6 address, minus the subnet

Exclude IPv6 filter example

Use regular expressions for more complex filters 

Regular expressions let you create custom IP exclusion filters. For example, here's how to exclude the address 192.100.0.1 and any subnets of 192.168.0:

  • Filter name: enter a name
  • Filter type: Custom
  • Select filter type: Exclude
  • Filter field: IP Address
  • Filter pattern: ^192\.100\.0\.1$|^192\.168\.0.*$

 

Exclude regular expression filter example

Make sure the filter works

You can verify most types of filters before you save them (using the Verify this filter feature). Unfortunately, it's not possible to verify an IP address filter in this way. You can, however, use the Google Tag Assistant Chrome browser extension to record a flow on your website that sends hits to your property. The extension has an Analytics report that can show the effects of any filters set for your view.

Use Tag Assistant Recordings

Tag assistant menus. Change location is 3rd from the top
  1. Follow the instructions in Get started with Tag Assistant Recordings to install the extension and record a flow on your website. (It's not important that the flow be recorded inside or outside of your corporate network.)
  2. Step 8 of those instructions tell you to open the Google Analytics Report tab. Do that, then click Change location in the left hand menu panel.
  3. Enter an IP address you expect your filter to exclude.
  4. Click Update.

Tag Assistant Recordings will reanalyze your report as if the hits came from the IP address you entered. If you set up your IP filter correctly, then the report should show all hits to this view filtered out.

Tag Assistant Recordings change location dialog
Changing a location IP address
Tag Assistant Google Analytics report showing Hit 1 has been filtered from the view (mutations section)
Analytics report, showing effects of IP filter

Was this helpful?

How can we improve it?
true
Choose your own learning path

Check out google.com/analytics/learn, a new resource to help you get the most out of Google Analytics 4. The new website includes videos, articles, and guided flows, and provides links to the Google Analytics Discord, Blog, YouTube channel, and GitHub repository.

Start learning today!

Search
Clear search
Close search
Google apps
Main menu