Background
Following their introduction of hostname data filters earlier this year – see our previous post – Google has recently made some improvements to it.
Previously, hostname data filters in GA4 could only exclude values from entering your data set. If a rogue domain started sending events to your property, the only way to deal with it was to add it to an exclude list, one at a time. Plus, ongoing manual updates were required to keep up with new sources of spam.
The latest update from Google simplifies this: you can now ensure that only a select list of values can enter your property with an include filter. A property can keep an allowlist of the domains that are allowed to send it event data and GA4 drops events from any hostname that is not on the list.
Ghost spam remains an issue
There are still areas to be mindful of.
Events with an empty hostname are blocked automatically and Measurement Protocol events are exempt from hostname include filters. This means any ghost spam being sent through that route still gets in. There’s good reason for this: you don’t want to accidentally cut off legitimate server-side tracking, but it does mean the include filter doesn’t fully solve the spam issues.
Anyone relying on Measurement Protocol integrations should know this filter gives them no protection.
There’s also no flexibility in matching. You still need to list every variant separately, www and non-www, any checkout or booking subdomains on a different host or any partner domain that legitimately fires your tag.
Finally, as with the previous hostname filters release, there is still no ability to define your hostnames using regex.
How to set up a GA4 hostname filter
We would recommend testing your filters in Test mode for a full weekly cycle before switching to Active, not just the 24-36 hours Google suggests as a minimum. We would also suggest using the your hostname report to help build the allowlist rather than relying on memory of what your domains are supposed to be.
Summary
The upgrade to the GA4 Hostname data filter is a welcome improvement, removing one of the main flaws of the previous version.
If you’re not sure what this means for your own GA4 or GTM setup, or would like a hand putting it into practice properly, get in touch with 120Feet and we’ll work through it with you.
