Cookie preferences

Choose which optional cookies EndFrame may use on this site. Analytics and advertising tools load only if you allow them, and you can change your mind any time from “Cookie settings” in the footer. Whatever you choose, this tab keeps the campaign labels from the link that brought you, and they are saved with your account if you sign up. Read the Cookie Policy.

Needed for the site to work, such as remembering this choice. Always on.

Lets us load analytics tools through Google Tag Manager, including Google Analytics and Microsoft Clarity session recordings, to understand how the site is used.

Allows advertising tags to measure our ad campaigns. None run on this site today. It also keeps ad click IDs from the page address for this tab, and saves them with your account if you sign up.

Skip to main content

How to Exclude Internal Traffic in GA4: IP Rules, Data Filters and Testing

A step-by-step guide to keeping staff and agency visits out of GA4: the internal traffic rule, the data filter and its Testing, Active and Inactive states, how to check it before activation, and what to do when IP addresses keep changing.

The EndFrame Team7 min read

To exclude internal traffic in GA4 you do two separate things, and you need both. First you define an internal traffic rule on your web data stream, which tells GA4 which IP addresses belong to your team and labels their events. Then you create an internal traffic data filter and switch it from Testing to Active, which is the step that actually removes those events. Many properties have the first step done and the filter still sitting in Testing, so staff and agency visits keep inflating sessions and sometimes key events.

How the rule and the filter work together

Google states that GA4 does not log or store IP addresses. That means you cannot filter by IP after the fact: the match has to happen as each event arrives. When an event comes from an address that matches your rule, GA4 adds an event parameter called traffic_type with the value you chose, internal by default. The rule on its own removes nothing. The data filter reads that parameter and, once Active, excludes matching events before they are processed. Google says this is permanent: excluded data is never processed and is not available in GA4 or BigQuery. Historical data is not changed.

PieceWhere it livesWhat it does to your data
Internal traffic ruleAdmin > Data streams > your web stream > Configure tag settingsLabels matching events with traffic_type; removes nothing
Data filter in TestingAdmin > Data filtersMarks matching events in the Test data filter name dimension; they stay in reports
Data filter in ActiveAdmin > Data filtersExcludes matching events permanently, from the time it takes effect
Data filter in InactiveAdmin > Data filtersNot evaluated at all
Report filterInside a detail report, via + Add filterHides rows in that view; stored data is unchanged

You need the Editor role or higher on the property to define internal traffic and to create, edit or delete data filters. If the Data filters screen is read-only for you, that is the reason.

Step 1: define internal traffic on the web data stream

  1. 1Open Admin. Under Data collection and modification, click Data streams.
  2. 2Click your web data stream, then click Configure tag settings.
  3. 3Click Show more, then Define internal traffic, then Create.
  4. 4Give the rule a name you will recognise later, such as London office.
  5. 5Leave the traffic_type value as internal unless you want separate labels for different locations. Whatever you enter here is the value the filter will look for.
  6. 6Under IP address, choose a match type and enter the value. The What's my IP address? option shows the public address of the connection you are using right now.
  7. 7To cover more addresses, click Add condition. Conditions are combined with OR, so an event matching any one of them is labelled internal. Then click Create.

Choosing the match type

GA4 accepts both IPv4 and IPv6 addresses and offers six match types. The example values below use the address blocks reserved for documentation; replace them with your own.

Match typeExample valueGood for
IP address equals203.0.113.7One office line with a fixed address
IP address begins with203.0.113.A block of addresses that share a start
IP address ends with.7Rarely useful; easy to catch outsiders by accident
IP address contains.113.Rarely useful for the same reason
IP address is in range203.0.113.0/24 or 2001:db8:4f2a::/48A range your provider or IT team gives you, in CIDR notation
IP address matches regular expression^203\.0\.113\.(7|8|9)$Several specific addresses in one condition

CIDR notation writes a range as a starting address plus the number of leading bits that stay fixed. In 203.0.113.0/24 the first 24 bits are fixed, so the range runs from 203.0.113.0 to 203.0.113.255, which is 256 addresses. IPv6 ranges use the same format. A range is safer than a single address only if the whole range belongs to you; otherwise it quietly labels real customers as internal.

Step 2: create the data filter and test it

  1. 1In Admin, under Data collection and modification, click Data filters.
  2. 2Click Create filter and choose Internal traffic.
  3. 3Enter a filter name. It must be unique in the property, start with a letter (letters from any language are allowed), use only letters, numbers, underscores and spaces, and be 40 characters or fewer.
  4. 4Choose the Exclude operation. The filter removes events whose traffic_type value matches the value you set, so keep it the same as the value in your rule.
  5. 5Set the filter state to Testing and click Create.

A property can have up to 10 data filters, and that limit covers every type (internal traffic, developer traffic and web hostname filters), so plan before adding one filter per office. Google says a new filter can take 24 to 36 hours to take effect.

Check the labels before you activate

In Testing, GA4 keeps every event in your reports but marks the ones the filter would remove with a dimension called Test data filter name. To see them, go to Explore and start a Free form exploration. Add Test data filter name and Event name as rows, Event count as the value, and a filter where Test data filter name contains the name of your filter. If the table is empty straight after setup, wait for the 24 to 36 hours to pass, browse the site from the office, and check again.

Then sanity-check the numbers. If ten people in one office produce a few hundred labelled page_view events a day on a site that records tens of thousands, the rule looks right. If a large share of your purchase or generate_lead events carry the label, the range is catching customers, and activating it would delete real conversions for good.

Switch it to Active

When the labelled data looks right, open the filter, change the state to Active and save. Allow the same processing time again. From then on, matching events are not processed at all, so your own visits should drop out of reports, which can look like a broken tag; if you are unsure which it is, our guide to GA4 not showing data separates the two. Google does not say how Realtime behaves with data filters, and some users still see internal visits there, so do not judge the filter by one Realtime check. Setting the filter to Inactive later stops it being evaluated, but nothing removed while it was Active comes back.

Why the GA4 internal traffic filter looks like it is not working

  • The filter is still in Testing. Testing labels events and never removes them. This is the most common cause.
  • Not enough time has passed. Allow 24 to 36 hours after creating the filter or changing its state.
  • The IP address changed. Home broadband and many business lines use dynamic addresses that the provider can change without notice.
  • People are not on the office network. Home Wi-Fi, mobile data and a VPN that exits somewhere else all present an address your rule does not know.
  • Only one IP version is covered. On a connection that supports both, the browser may reach Google over IPv6, so an IPv4-only rule misses it. A range on your IPv6 network prefix usually lasts longer than a single address.
  • The values do not match. A rule that sets traffic_type to office_london and a filter looking for internal will never meet.
  • Requests go through a server first. Practitioners report that the IP-based label is not reliably added when hits pass through a server-side Google Tag Manager container or Google tag gateway. Google's documentation does not cover this case, so if you use either, check the Test data filter name labels before relying on the IP rule, or set traffic_type yourself or handle it in the server container.

Options when your team's IP addresses are not stable

An IP rule describes places, not people, so for a remote team, freelancers or an agency it only catches part of the internal traffic.

Set traffic_type yourself

Google's help page notes that you can add the traffic_type parameter to events manually, and the same Internal traffic filter will act on it. A common Google Tag Manager pattern, described by Analytics Mania, has staff open the site once with ?internal_user=true in the URL. A tag sets a first-party cookie, and a cookie variable passes internal into the traffic_type parameter on the Google tag. The cookie lives in one browser on one device, disappears when cookies are cleared, and Safari can shorten its life. If your staff log in to the site, a developer can push a staff flag into the data layer instead, which survives across devices.

Use the developer traffic filter for testing

The developer traffic data filter targets events sent in debug mode, which suits the people who test tags and forms. It needs no IP rule: create it under Data filters by choosing Developer traffic, and test it the same way. Our guide to GA4 DebugView explains how to turn debug mode on. One practitioner caution, which Google does not document: when an event carries both debug mode and an internal traffic_type, an Active internal filter can stop it reaching DebugView, so testers on the office network may see an empty stream. If that happens, test from a network outside the rule.

Hide rather than delete

Report filters, added with + Add filter in a detail report, hide rows without touching stored data. They cannot match on IP, since GA4 does not keep it, but they can exclude a hostname, a test campaign or a page path your team uses.

Checks before you switch a filter to Active

  • Every office, VPN exit and agency address is in the rule, in both IPv4 and IPv6 where the network has both.
  • The traffic_type value in the rule matches the value the filter excludes.
  • The Testing exploration shows labelled events from your team and almost none of your purchases or leads.
  • Someone has written down which filters exist and why, since the property allows only 10.
  • Bots and spam are handled separately: internal traffic rules only cover your own people, and our guide to the GA4 bot traffic filter covers the rest.

Frequently asked questions

Does excluding internal traffic in GA4 remove my past data?

No. A data filter only acts on events that arrive after it takes effect. Staff visits recorded before that date stay in your reports, and GA4 cannot reprocess them, because it does not keep IP addresses to match against later. For older date ranges, the practical option is to compare against periods you trust rather than expect a clean-up.

Can I exclude internal traffic from a GA4 app stream?

Not with the IP rule. Google states that internal traffic filtering does not apply to app users, and the rule is defined in the tag settings of a web data stream. For people testing an app, the usual route is to run test builds in debug mode and use the developer traffic filter, which is aimed at events sent in debug mode.

What is the difference between Testing and Inactive for a GA4 data filter?

A filter in Testing is evaluated on every incoming event and labels matches in the Test data filter name dimension, but keeps them in reports. An Inactive filter is not evaluated at all, so nothing is labelled. Neither state removes data. Inactive is useful for pausing a filter without deleting it, and it does not bring back events removed while it was Active.

Should I add my IPv4 address, my IPv6 address, or both?

Both, if your network has both. A connection that supports IPv6 may reach Google over either protocol, so a rule with only one version can miss part of your traffic. Use the What's my IP address? option on each network your team uses, and ask whoever runs the network for the full ranges rather than relying on one reading.

Try EndFrame

Add a server-side path for your conversions.

EndFrame collects events first-party and forwards conversions server-side to Meta, GA4, TikTok, and webhooks with event-ID deduplication — then credits each conversion to its campaign, with the visit-to-conversion path you can audit.

No credit card required

Keep reading