LW IT Solutions
« Blog Overview /Digital Analytics / GA4 Hostname Include Filter: Allowlist, Empty Hostnames...
Read this article in other languages:

GA4 Hostname Include Filter: Allowlist, Empty Hostnames Blocked, Measurement Protocol Exempt

GA4 Hostname Include Filter: Allowlist, Empty Hostnames Blocked, Measurement Protocol Exempt
Contents
  1. What the release note defines
  2. What this means in practice
  3. What the note leaves open
  4. An order of steps that avoids a deletion
  5. Include or Exclude
  6. Assessment
  7. Questions and answers
  8. Sources

Since 21 September 2026 the hostname filter in GA4 has a second mode. Until then it could only exclude: the filter of 11 June 2026 dropped events whose hostname was on a list. The new Include mode turns the direction around. The list now names the approved domains, and every event with any other hostname is dropped.

Google describes the benefit as less upkeep. Anyone excluding spam and test systems one by one has to add every new foreign domain; an allowlist only needs the own domains. The price is a different risk: a missing domain costs real traffic, and a dropped event is gone for good.

A sorting diagram with four lanes: events with a hostname on the list pass the Include filter and stay, events with another hostname or with an empty hostname are dropped, and events sent through the Measurement Protocol bypass the filter and stay; beside them three notes on testing mode, order and irreversibility
Four kinds of events at a hostname Include filter. Only the Measurement Protocol lane bypasses the filter.

What the release note defines

The note of 21 September and the Analytics Help page on data filters set out five rules.

  • Allowlist. Events whose hostname is not on the list are dropped.
  • Empty hostnames. An Include filter blocks events without a hostname automatically. Google’s reason is that a missing hostname usually points to spam or abnormal traffic; gtag.js traffic is named as an example.
  • Measurement Protocol. Include filters are not applied to events sent through the Measurement Protocol; that data stays unblocked.
  • Order. All active Include filters are combined and applied first as a group, then any active Exclude filters in sequence.
  • Permanent and forward only. A data filter is evaluated from the moment it is created and does not touch historical data. What it drops is never processed and is never available in GA4 or BigQuery.

What this means in practice

The route of ghost spam stays open. Ghost spam arises when someone reads a measurement ID from the page source and sends hits straight to the collector, usually through the Measurement Protocol; the sender then sets the hostname. That is exactly the route Include filters skip. An allowlist keeps out traffic from wrong hostnames in the browser – test systems, clones of the site, proxies that carry the tag along – but not necessarily the spam that is usually meant when hostname filters come up. The release note states the exemption for Include filters only; how an Exclude filter behaves there is not described.

Every domain in use belongs on the list. Not just the main domain, but also subdomains for shop, blog or landing pages, checkout and booking services that run under a foreign domain with the same measurement ID, and domains joined by cross-domain measurement. If one is missing, its events disappear without a message. With a checkout on a partner domain, those are the purchases.

Empty hostnames are not settled by the note. The bracket in Google’s sentence leaves open whether ordinary gtag.js events carry a hostname or only certain malformed ones lack it. The note does not say whether regular page views ever arrive without a hostname; testing mode shows that in the property’s own data.

What the note leaves open

Two points are not described, and both decide whether a list works as intended.

  • Matching. Google’s guide names the options “Exactly matches” and “Contains”. Whether a list entry for example.com also admits www.example.com is not described. With “Contains” a substring is enough, so a hostname such as example.com.other.example would pass a list containing example.com; with “Exactly matches” every spelling needs an entry of its own.
  • Combination. The Help page fixes the order, but the note does not say whether an Include and an Exclude filter for hostnames can exist side by side in one property, nor how filters behave for app data streams.

An order of steps that avoids a deletion

Include filter: steps before it is made active

  1  open a report with the dimension hostname and list every
     value of the past 90 days
  2  assign each name: own domain, partner or checkout,
     test system, foreign
  3  build the list of approved hostnames from the first
     two groups
  4  create the filter in testing mode and leave it for
     24 to 36 hours
  5  in a free exploration, look at Test data filter name,
     Event name and Event count by hostname
  6  only then make it active, and note the day

  Step 5 is the check: a revenue event such as purchase among
  the events the filter would remove means a domain is missing.

Include or Exclude

Aspect Exclude Include
The list contains unwanted hostnames approved hostnames
A new foreign domain stays in the data until it is added is dropped automatically
A new own domain no effect is dropped until it is entered
Empty hostname not described blocked automatically
Measurement Protocol exemption not named in the note exempt
Consequence of a mistake too little removed: the data stays polluted too much removed: real data is gone for good

Assessment

Include suits a property with few, fixed domains, where every host is known and new ones are rare. With many changing domains – campaign sites, partner systems, agencies – the list itself becomes the source of errors, because every addition depends on someone remembering it. In every case the filter is no substitute for looking at where Measurement Protocol hits come from, since that route stays outside it.

This article rests on Google’s documentation and release notes, not on a measurement in a property of its own. Where the documentation is silent, it says so; testing mode is the way to settle those questions with real data before anything is deleted.

Questions and answers

Does a server container’s subdomain need to go on the list of approved hostnames?

As a rule, no. An event’s hostname comes from the page address the hit carries (page_location, dl in the request), not from the address it is sent to. A hit from www.example.com that travels through sgtm.example.com still carries www.example.com, as long as the server container passes the page address on unchanged.

Events without a page address are the tricky part. A purchase that the backend sends through the server container after the order is confirmed is created without a browser and often carries no dl; it would arrive without a hostname and fall under the automatic block on empty hostnames. The Measurement Protocol exemption cannot be relied on here: the server container forwards such events through its GA4 tag, and whether GA4 then treats them as Measurement Protocol is not described in the note.

The safest option is for the backend event to carry the confirmation page’s address as page_location. Step 5 of the list in the article shows whether such purchases are affected: if purchase is among the events the filter would remove and the hostname there is empty, it is exactly this route that is responsible.

Does the list of unwanted referrals replace a hostname filter?

No, the two govern different things. The unwanted referrals list in the data stream settings drops nothing; it only prevents a domain from counting as a referral source, such as a payment service from which buyers return to the confirmation page. The Include filter, by contrast, decides on the event’s own hostname and drops events for good.

That gives a simple rule of assignment. A payment service that does not run the tag belongs on the unwanted referrals list, not on the allowlist. It only belongs on the allowlist if events with the same measurement ID originate there, as the article describes for checkout and booking services under a foreign domain.

Are hits from local development and test systems dropped as well?

Yes, unless localhost or the test host is on the list, and that is usually what is wanted. Test systems that are meant to be measured are better served by a property with a measurement ID of their own than by adding their hostnames to the production property’s list; otherwise the test data mixes back into the real figures.

Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in Touch

Briefly describe your project or inquiry for a tailored response. This site is protected by reCAPTCHA.

Write a comment

Differing figures from other accounts and questions about the setup are welcome here.

The email address is not published. Required fields are marked with an asterisk.

Articles & categories

CCTV

Follow this category by RSS

Cloud & AI

All 17 articles in this category Follow this category by RSS

Data Privacy

All 19 articles in this category Follow this category by RSS

Digital Analytics

All 58 articles in this category Follow this category by RSS

Digital Marketing

All 37 articles in this category Follow this category by RSS

IT & Networks

All 19 articles in this category Follow this category by RSS

Music Production

All 17 articles in this category Follow this category by RSS

Raspberry PI

Follow this category by RSS

SaaS & Internet Earning

Follow this category by RSS

Smart Home

All 18 articles in this category Follow this category by RSS

Web Development

All 11 articles in this category Follow this category by RSS

WordPress Plugins & Tricks

All 14 articles in this category Follow this category by RSS