This guide is for bloggers, small business owners and agency staff who run a Google Analytics 4 (GA4) property for a small website and want cleaner reports. Google’s “What’s new in Google Analytics” page lists an update dated 21 September 2026: hostname data filters can now work as an allowlist. Below you will find how to see which hostnames send data to your property, how to build the filter, how to test it first, and which mistakes to avoid.
What changed on 21 September 2026
Google’s release notes describe “Include data filters for hostnames.” Before this, the hostname filter could only exclude domains, so you had to keep adding new spam sources by hand. With an Include filter you list the domains you approve, and everything else is left out.
The release note also lists two details worth knowing before you switch anything on:
- Hostname Include filters are not applied to events sent through the Measurement Protocol, so that data is not blocked by them.
- Include filters automatically block events with empty hostnames, such as gtag.js traffic. Google says a missing hostname usually signals spam or abnormal traffic.
The Measurement Protocol is a way for servers or other systems to send events to GA4 directly, outside the browser tag. If you use it, an Include filter will not clean that stream, and it will not remove it either.
Step 1: Find out which hostnames send data
Before you write an allowlist, you need to know what is on it. Google’s dimensions reference lists a Hostname dimension in the Page / screen category, described as the subdomain and domain names of a URL that people visited on your website. That is the field a hostname filter looks at. One caveat from the same page: if you manually populate the page_location parameter, it overrides the automatically collected hostname value, so a custom setup can change what you see.
To list hostnames, open Explore, start a new exploration and use the Free form template, then add the Hostname dimension and a metric such as Event count. Google’s filter guide uses a similar Free form layout to check filters, and it confirms the results can be grouped by hostname. If you have not built an exploration before, our GA4 Explorations guide for small sites and bloggers covers the basics.
Pick a date range that is long enough to catch quiet hosts, then sort by event count. Sort out what you see into three groups:
| Hostname type | Example pattern | Usually |
|---|---|---|
| Your live site | www.example.com and example.com | Keep |
| Other hosts you own | shop.example.com, blog.example.com | Keep if they use the same property |
| Hosts you use on purpose | A checkout or booking domain in a cross-domain setup | Keep |
| Staging or test copies | staging.example.com | Decide deliberately |
| Unknown domains | Anything you do not recognise | Investigate, then leave out |
Step 2: Create the data filter
Google’s help page on filtering web hostname traffic says you need the Editor role or higher on the property. The menu steps are:
- Go to Admin. Under “Data collection and modification,” select Data filters.
- Select Create filter, then choose Web hostname traffic filter.
- Enter a filter name. It must be unique among the property’s data filters, start with a letter, use only letters, numbers, underscores and spaces, and be 40 characters or fewer.
- Under Filter operation, choose Include only for an allowlist, or Exclude to block specific hosts.
- Choose a match type: exactly matches, begins with, ends with or contains.
- In the Hostname field, enter the hostname or string to match.
- Choose a filter state: Testing, Active or Inactive. Start with Testing.
- Select Create, then Done.
The help page describes “Include only” as processing only data that matches your conditions. The page’s wording refers to a single hostname string per filter. It does not say how to combine several approved hosts, so the options below are an interpretation rather than a documented recipe: either use a match type such as ends with on your registered domain (which covers subdomains and the bare domain), or check in the Data filters screen whether you can add more than one Include filter. Google’s overview page says active Include filters are combined and applied together as a group before Exclude filters run, which suggests several Include filters work as one allowlist, but test that on your own property.
Step 3: Test before you go live
The three filter states behave differently:
- Testing: GA4 tags matching data with the “Test data filter name” dimension, so you can check the filter before it changes anything.
- Active: GA4 applies the filter to incoming data, and the changes are permanent.
- Inactive: GA4 does not evaluate the filter.
Google recommends validating in Explore. Use the Free form template, add the dimensions Test data filter name and Event name, add the metric Event count, and put the two dimensions in Rows and the metric in Values. Add a filter on Test data filter name, set to contains, with your filter’s exact name, then select Apply. Google advises waiting 24 to 36 hours after setting the filter to Testing. If hostnames you want to keep show up as filtered, adjust the match conditions and check again.
When the results look right, go back to Admin > Data filters, open the filter, set Filter state to Active and select Save. Google says the filter starts affecting data within 24 to 36 hours.
Filters are not retroactive and cannot be undone
Two points from Google’s documentation matter here. First, filters apply only to new data. They do not change data already collected, so old spam stays in your historical reports. Second, once a filter is active its effect is permanent: excluded data is never processed and is never available in Google Analytics or BigQuery. If you only want to hide data in certain reports, Google points to report filters instead.
Common mistakes
Forgetting www versus non-www
An “exactly matches” filter for www.example.com will not match example.com, because the match must have no extra characters before or after. If both versions ever load your tag, include both or use a broader match.
Missing subdomains and extra hosts
Shops, booking tools, members’ areas and help centres often live on a subdomain or a separate domain. If they send data to the same property and you leave them off the allowlist, their traffic disappears. Check the hostname list in Step 1 for every place your tag runs. Our Google Tag Manager setup guide is a good reminder of where the tag may be firing.
Ignoring cross-domain and payment hosts
If a checkout runs on another domain and you rely on it for conversion data, an Include filter that omits that host will drop those events. Confirm the hostname appears in your exploration before deciding.
Blocking your own staging site by accident
An allowlist will exclude a staging copy, which is usually what you want, because test visits stop polluting reports. The risk is the reverse: you may later want to check tracking on staging and find no data arrives. Our guide to using a WordPress staging site before you update explains why you might test there, so plan a way to check tracking, for example with a separate property.
Expecting it to fix everything
The filter does not touch Measurement Protocol events, and it only handles the hostname field. Spam that sends a hostname you have approved would still get through. Treat it as one layer of cleanup, not a complete defence.
Key takeaways
- Since 21 September 2026, GA4 hostname filters can use Include only, letting you allowlist approved domains instead of chasing spam sources.
- Use the Hostname dimension in Explore to list every host sending data before you write the filter.
- Create the filter in Admin > Data filters > Create filter > Web hostname traffic filter, and begin in Testing state.
- Validate with the Test data filter name dimension, wait 24 to 36 hours, then set the filter to Active.
- Include filters block empty hostnames, ignore Measurement Protocol events, and are not retroactive. Active filters permanently drop data.
FAQ
Will an Include filter clean up spam already in my reports?
No. Google states that traffic filters apply only to new data and do not change data already collected.
Does the filter affect Measurement Protocol events?
Google’s release note says hostname Include filters are not applied to Measurement Protocol events, so that data is not blocked by them.
What happens to events that have no hostname?
Include filters automatically block events with empty hostnames, such as gtag.js traffic. Google says a missing hostname usually points to spam or abnormal traffic.
How long should I leave a filter in Testing?
Google recommends waiting 24 to 36 hours after setting Testing before you validate in Explore, and says an Active filter takes effect within 24 to 36 hours.
