Sub topic 6
Testing, Active, and Inactive filter states
This chapter covers the three states a GA4 data filter can be in, what each one does to your data, and how to move between them without losing anything you can't get back. It assumes you have a GA4 property with a web data stream, Editor or Administrator access, and an internal traffic rule already defined (covered in the previous chapters). You should also know the difference between an event, a session, and a traffic source.
Why filters have states
A data filter changes what GA4 stores. When a filter is active, matching events are dropped during processing and never reach your reports. GA4 has no way to bring them back. This is different from a report filter or a comparison, which only hides data you can still see later.
Because of that, GA4 gives every data filter a state. The state controls whether the filter only labels matching events, removes them, or does nothing. The states let you check a filter's behavior on real traffic before you commit to deleting data.
The three states
| State | What happens to matching events | Reversible? |
|---|---|---|
| Testing | Events are kept in reports. GA4 records which filter would have matched, in the Test data filter name dimension. | Yes, fully |
| Active | Events are excluded during processing and are not stored in standard reports. | No. Excluded events are gone for good |
| Inactive | The filter is ignored. Events pass through as if it did not exist. | Yes, but data from the Active period stays missing |
Testing
Testing is the safe state, and it is the default for the internal traffic filter that GA4 creates for you. In this state:
- Matching events are still processed and appear in your standard reports.
- GA4 adds the filter's name to the Test data filter name dimension on each matching event.
- You can compare matching and non-matching traffic in Explorations and see exactly what an Active filter would remove.
Nothing is lost while a filter is in Testing, so you can leave it there as long as you need. The cost is that your reports still include the internal traffic until you switch the filter on.
Active
In Active, GA4 applies the filter to incoming data. For an internal traffic filter set to Exclude, any event whose traffic_type value matches the filter is discarded. The same applies to the developer traffic filter: events sent with debug_mode are discarded.
Two consequences matter in practice:
- The exclusion is permanent for the events it removes. Switching the filter back to Testing or Inactive later does not restore them.
- The filter applies from the moment of activation onward. It does not clean data collected earlier. Past internal traffic stays in your reports.
GA4 applies filter changes to new data only, and activation can take up to 24 hours to take effect. Plan for a window during which the filter's behavior is not yet consistent.
Inactive
An Inactive filter is stored but has no effect. Use it when you want to keep a filter's configuration without applying it, for example while the office changes its network and your IP ranges are out of date.
Moving an Active filter to Inactive stops new exclusion. It does not recover events that were dropped while the filter was Active.
State transitions
Filters move between states with a few rules. You can switch freely among Testing, Active, and Inactive, but the data effects are not symmetric, as the diagram shows.
The practical rule: Testing to anything is safe, and anything to Active starts permanent data removal.
Setting the state
You change a filter's state in the property settings.
- Open Admin, then under Data collection and modification choose Data filters.
- Select the filter you want to change. The list shows each filter's name, type, and current state.
- Choose the new state and save.
Creating a new filter asks you to pick a state at the same time. If you are unsure, pick Testing. A new filter you create yourself can start as Testing, and the choice is yours.
Property settings changes take effect for new events only. Keep a record of when you changed each state so you can explain gaps or drops in your numbers later.
Worked example: rolling out an office filter
Suppose your office uses the public range 203.0.113.0/24. You already created an internal traffic rule that sets traffic_type to internal for that range, and a data filter that excludes internal.
- Leave the filter in Testing for at least a few days of normal working traffic. Do not rush this step.
- Confirm the rule is working. Visit your site from the office network, then open Admin, DebugView or a report, and check that events carry
traffic_type = internal. The rule is what sets the value. The filter only reads it. - Check the dimension. In an Exploration, add Test data filter name as a dimension and event count as a metric. You should see your filter's name attached to a plausible share of events, such as a few percent for a public site, or much more for a site with few visitors.
- Look for false positives. If the share is far larger than expected, your range may be too wide, or the rule may match shared hosting or a partner's network. Fix the rule before activating.
- Activate. Switch the filter to Active and record the date and time.
- Recheck after processing. After up to 24 hours, confirm that new internal visits no longer appear and that overall traffic still looks normal.
If you want to confirm the value being sent from a page, you can set it on the page directly while testing:
gtag('config', 'G-XXXXXXXXXX', {
'traffic_type': 'internal'
});An event tagged this way carries the same value a rule would set, so the filter treats it the same way. This is useful for a quick check, but remember that a value set in code and a value set by a rule are both matched by the same filter, so a mistake in one place can hide a problem in the other.
Common errors
- Going Active with no testing. If the rule is wrong, you delete real customer events permanently. This is the most costly mistake in this chapter.
- Expecting retroactive cleanup. Activating a filter does not remove earlier internal visits. Annotate the date so analysts know the data changed.
- Testing mistaken for working. In Testing, internal traffic still shows in standard reports. A report that still contains your own visits is not evidence of a broken filter. Look at the Test data filter name dimension instead.
- Typo in the filter value. The filter compares text exactly. A rule that sets
internaland a filter that excludesInternalwill not match. Use the same lowercase value in both places. - Forgetting Inactive filters. An Inactive filter looks present in the list but excludes nothing. Review the state column during audits.
- Two filters overlapping. An event excluded by any one Active filter is gone, so overlapping filters can remove more than you intended. Review the combined effect.
The developer traffic filter
The developer traffic filter works the same way, with one difference in what it matches. It targets events that include the debug_mode parameter:
gtag('config', 'G-XXXXXXXXXX', {
'debug_mode': true
});These events appear in DebugView. If the developer traffic filter is Active, they are excluded from standard reports. If it is in Testing, they stay in reports and are labeled. The same advice applies: test first, then activate.
Reading state in practice
A quick way to review a property is to list each filter with its state and decide what the state should be.
| Situation | Suggested state |
|---|---|
| New rule, not yet checked | Testing |
| Rule checked, share of matches looks right | Active |
| Network ranges are out of date | Inactive until updated |
| Investigating a sudden traffic drop | Check whether a filter recently became Active |
Exercise
A colleague says, "The internal traffic filter is in Testing, but my own visits still show up in the Traffic acquisition report, so the filter must be broken." Is that conclusion correct? What would you check, and what would you do before moving the filter to Active?
Show answer
No. In Testing, matching events are kept in reports by design, so your own visits still appearing is expected. To check the filter, add the Test data filter name dimension in an Exploration and confirm that your visits carry the filter's name. Also confirm the rule sets traffic_type to the same value the filter excludes, and check that the share of matched events is plausible. Only then switch the filter to Active, record the date, and recheck after up to 24 hours. Remember that Active exclusion is permanent and not retroactive.
Exercise
You activated an internal traffic filter last week and later found that the IP range in the rule was too wide and also matched a partner company. You change the filter back to Inactive. Do the partner's earlier events return to your reports?
Show answer
No. Events dropped while the filter was Active were never stored, and switching to Inactive only stops new exclusion. You should correct the rule, return the filter to Testing to confirm the corrected match, and note the affected dates so analysts know the data has a gap.