SPAM Filter in Google Analytics 4


What SPAM ist and which types there are can be found in our Dictionary article about SPAM.

Since most spam attacks using the Google Analytics Measurement Protocol, there is a good remedy for SPAM at GA4. Because Google Analytics 4 brings an effective hedge against unauthorized access via the Measurement Protocol by creating for the Measurement Protocol hits an API Key with a Secret Value::

Create a Measurement Protocol API-Secret

To create the API secret, we click in the Analytics Admin for the corresponding (GA4) property on “Data Streams” and there on the corresponding stream. Then the “Web stream details” should appear, where you click on “Measurement Protocol - API-Secrets”. If necessary, the conditions must first be accepted. Then you can use the blue button “Create” to create a new API secret:

The name (alias) can be chosen freely. Multiple API secrets can also be created, for example for different purposes.

Since the API Secret is nowhere public (usually) visible now spammers have no chance to abuse the Measurement Protocol for their attacks.

The spam hits that have been tracked, of course, remain available, since one in GA only limited data can erase ...

But what to do with spam attacks that using a headless browser (instead of the Measurement Protocol)? In theory, we can use the old Universal Analytics filter trick here. But …

GA4 Data Filter against SPAM

Unfortunately, Google is not yet very far with GA4 filters, currently only 2 filters exist:

According to an article in Search Engine Journal, Google is still working on the filters and there is no date for the launch of further filter options. Google itself recommends using a Universal Analytics Property in addition to the GA4 Property.

So at the moment we just can wait. After all, the new filter configuration looks promising, with the possibility of testing and so on ...