Sub topic 11
Excluding Traffic Without Fixed IP Addresses
This chapter assumes that you understand GA4 events, data streams, and data filters. It also assumes that you can edit your website or tag configuration. Fixed public IP addresses make internal-traffic exclusion easier, but many organizations use VPNs, mobile networks, cloud workspaces, or remote work. In those cases, IP-based rules are incomplete.
Why IP addresses are not always enough
An IP address identifies a network connection, not a person. A remote employee may use a different address each day. A VPN may give many users one shared address, while a mobile connection may change addresses during one session. IPv6 privacy addresses can also rotate.
If you exclude only known office addresses, visits from remote staff can remain in your reports. If you exclude a broad VPN or cloud-provider range, you may remove real customers who use the same network.
Use a signal that your organization controls when the network address is unreliable.
Choose a non-IP method
| Method | Best use | Main limitation |
|---|---|---|
| Separate property or data stream | Staff use a known internal application or hostname | Requires a deliberate tracking architecture |
| Login-based tagging | Employees authenticate before using the site | Does not cover anonymous staff visits |
| Server-side tagging | Your backend knows whether a user is an employee | Requires server or tagging infrastructure |
| Developer traffic filter | Developers need to test tags and events | Intended for debug traffic, not all internal visits |
| Exploration or audience exclusion | Analysis needs a temporary exclusion | Does not remove data from standard reports |
A separate property or stream gives the cleanest separation. It prevents internal events from entering the customer dataset, but it may make combined reporting more difficult. Login-based tagging is more flexible when employees use the same website as customers.
Mark authenticated staff as internal
Your application can identify an employee after login. The tagging layer can then add the traffic_type event parameter with a value such as internal. GA4's internal traffic data filter can exclude events with that value.
For a Google tag implemented with gtag.js, the configuration might look like this:
gtag('config', 'G-XXXXXXXXXX', {
traffic_type: 'internal'
});Only run this configuration for a confirmed internal user. Do not decide that someone is internal because a query parameter, cookie, or browser value is present by itself. Those values can be copied or changed by a visitor.
A safer design is:
- The user signs in.
- The application confirms that the account belongs to your organization.
- The application exposes a short-lived internal-user signal to the tag manager or page.
- The tag configuration sends
traffic_type: 'internal'. - The internal traffic data filter excludes that value.
The signal must be available before important events are sent. If the first page view is sent before the login state is known, that event may not receive the internal marker.
Use debug mode for development
Developers can use debug_mode when testing tags. GA4 recognizes these events as developer traffic, which a developer traffic filter can exclude when that filter is active.
gtag('config', 'G-XXXXXXXXXX', {
debug_mode: true
});This method is useful for tag testing, including testing from changing IP addresses. It is not a replacement for internal-traffic tagging. A normal employee visit is not automatically developer traffic, and debug mode should not be enabled for every employee or every customer session.
Validate the alternative
Test the complete path with a known internal account:
- Confirm that the request contains
traffic_type=internalor the equivalent tag parameter. - Open DebugView and check that the expected events arrive.
- Use the Test data filter name dimension to identify events matched by the filter.
- Compare a known customer session to ensure it is not marked internal.
- Check events sent before and after login.
Do not expect a newly activated filter to clean historical data. Data filters affect eligible incoming data after activation. Keep a record of the chosen signal, its owner, and the conditions that set it.
Audit the result
Review the property after deployment. Look for internal account events without the internal marker, customer events marked as internal, and developer events that lack debug_mode. Also check whether payment providers and authentication domains are handled in the unwanted referrals list. That list fixes attribution; it does not exclude visits.
Exercise
An employee works from home with a changing IP address and signs in to the company account. Which approach should you prefer, and what must you verify?
Show answer
Use login-based tagging or server-side tagging to set traffic_type to internal after the account is confirmed. Verify the parameter in DebugView, confirm the internal data filter matches it, and test that customer sessions are not marked internal.