Sub topic 2
Creating the Internal Traffic Data Filter
This chapter assumes you have a GA4 property with a web data stream, Editor or Administrator access, and the public IP addresses of your office or network. You should already know how events and sessions work in GA4.
Creating the filter
Internal traffic rules tag events that come from your IP addresses with a traffic_type value. A data filter then acts on that value. To create the filter:
- Go to Admin > Data settings > Data filters.
- Click Create filter, choose Internal Traffic, and name it.
- Set the
traffic_typevalue tointernal, which must match the value in your internal traffic rule. - Save the filter. It starts in the Testing state.
Testing, Active, and Inactive states
A filter has three states:
- Testing: GA4 tags matching events but still reports them. You can compare the two sets.
- Active: GA4 excludes matching events from reports. Activation applies to new data only. It does not change past data.
- Inactive: The filter has no effect.
Keep a new filter in Testing until you confirm it matches the right traffic.
Verifying a filter before you activate it
Check the filter in Testing state before you activate it:
- Open a report and add the Test data filter name dimension.
- Confirm that your internal visits appear under the filter name and that customer visits do not.
Activating a filter without this check can remove real data permanently from future reports.
Excluding developer traffic with debug_mode
Developers can send events flagged for debugging. Set this on the configuration call:
gtag('config', 'G-XXXXXXXXXX', {
'debug_mode': true
});Events with debug_mode appear in DebugView. The Developer Traffic filter excludes them when it is active.
> Keep the Developer Traffic filter in Testing until DebugView confirms the events you expect.
Exercise:
Exercise
Why should you keep a new internal traffic filter in Testing before you activate it?
Show answer
Testing tags matching events without removing them, so you can confirm the filter catches only internal traffic. Activation affects only new data, and a wrong filter would hide real visits from future reports.