Search
Clear search
Close search
Google apps
Main menu

Exclude internal traffic

Filter out traffic to your website from people on your corporate network.

Most of the time, Google 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

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. Click the Select filter type drop-down menu and select Exclude.
  4. Click the Select source or destination drop-down menu and select traffic from the IP addresses.
  5. Click the Select expression drop-down menu and 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 a Google 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 instuctions 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. 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)
Google Analytics report, showing effects of IP filter
Was this article helpful?
How can we improve it?
Google Analytics training and support resources

Check out our comprehensive list to learn more about Analytics solutions.