This article is about Google Analytics 4 properties. If you're using a Universal Analytics property, refer to the Universal Analytics section of this help center.

[GA4] Filter out internal traffic

This article is for website owners who want to filter out data from internal traffic. This article pertains to Google Analytics 4 properties; if you are using Universal Analytics, read this article instead.
You need the Editor role for the property to create, edit, and delete internal-traffic definitions. The ability to filter out internal traffic is only available in web data streams.

To filter out internal traffic, create a rule that defines the IP address or range of IP addresses that represent internal traffic.

The definition of internal traffic that you create with these rules serves as the basis for your filters to include or exclude internal traffic.

When you create a definition of internal traffic, the traffic_type parameter is automatically added to all events and has the parameter value you specify. You can also manually add the traffic_type parameter to your event code (e.g., by modifying your gtag.js code) and give it any value you want.

Steps

To filter out internal traffic, do the following:
  1. Identify internal traffic in your web data stream.
  2. Exclude internal traffic using a data filter at the property level.

Create filters in Analytics

Create definition

  1. Sign in to Analytics.
  2. In Admin, look at the Account and Property columns to make sure that you've selected your desired account and (Google Analytics 4) property.
  3. In the Property column, click Data Streams, and then click the web data stream for which you want to define internal traffic. (This option is not available for app data streams.)
  4. Under Additional Settings > More Tagging Settings, click and then.
  5. Click Define internal traffic.
  6. Click Create.
  7. Enter a name for the rule.
  8. traffic_type is the only event parameter for which you can define a value. internal is the default value, but you can enter a new value (e.g., emea_headquarters) to represent a location from which internal traffic originates.
  9. Under IP address > Match type, select one of the operators (e.g., IP address equals).
  10. Under IP address, enter an address or range of addresses that identify traffic from the location you identified in Step 8. You can enter IPv4 or IPv6 addresses.

    The following examples show how to identify IP addresses for each operator:
    • IP address equals: 172.16.1.1
    • IP address begins with: 10.0.
    • IP address ends with: .255
    • IP address contains: .0.0.
    • IP address is in range (ranges need to be expressed in CIDR notation):
      • 24-bit block (e.g., 10.0.0.0 – 10.255.255.255): 10.0.0.0/8
      • 20-bit block (e.g., 172.16.0.0 – 172.31.255.255): 172.16.0.0/12
      • 16-bit block (e.g., 192.168.0.0 – 192.168.255.255): 192.168.0.0/16
  11. Click Create.

Using CIDR notation

Classless Inter-Domain Routing (CIDR) notation is a way to represent ranges of IP addresses.

The following examples use IPv4 addresses. CIDR-notation syntax is the same for IPv6 addresses.

IPv4 addresses are 32-bit binary numbers with the values for each octet ranging from 0-255.

For example, the IPv4 address

10.10.101.5

has the 32-bit binary equivalent of

00001010.00001010.01100101.00000101

When you express a range of IP addresses in CIDR notation, you indicate how many of the bits are fixed and how many can be of any value. For example, the CIDR notation for the range of addresses 192.128.255.0 - 192.168.255.255 is 192.168.255.0/24.

/24 indicates that the first 24 bits (192.128.255) are fixed and the last 8 bits (.0) are wildcards that can take any value (0 is the standard wildcard).

If you needed to indicate a range of 192.168.0.0 – 192.168.255.255, you would indicate that the first 16 bits of the address are fixed: 192.168.0.0/16.

/16 indicates that the first 16 bits (192.168) are fixed and the last 16 bits (.0.0) are wildcards that can take any value.

If you were using IPv6 addresses and wanted to express a range, you would use the same "slash-number" suffix to indicate how many bits of the range are fixed. For example, if the range were 0:0:0:0:0:ffff:c080:ff00 - 0:0:0:0:0:ffff:c080:ffff, you would express the range as 0:0:0:0:0:ffff:c080:ff00/120 (the first 120 bits are fixed).

Learn more about CIDR notation.

Edit definition

  1. Sign in to Analytics.
  2. In Admin, look at the Account and Property columns to make sure that you've selected your desired account and (Google Analytics 4) property.
  3. In the Property column, click Data Streams, and choose the web data stream for which you want to edit the internal-traffic definition.
  4. Under Additional Settings > More Tagging Settings, click and then.
  5. Click Define internal traffic.
  6. Click the row for the definition.
  7. Click Edit.
  8. Make the changes you want, then click Save.

Delete definition

  1. Sign in to Analytics.
  2. In Admin, look at the Account and Property columns to make sure that you've selected your desired account and (Google Analytics 4) property.
  3. In the Property column, click Data Streams, and choose the web stream for which you want to define internal traffic.
  4. Under Additional Settings > More Tagging Settings, click and then.
  5. Click Define internal traffic.
  6. Click the row for the definition.
  7. Click More > Delete.

Related resources

Data filters

Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
69256
false