Keep Cookiebot's scanner out of GA4: IP addresses and user agent
Once a month, Cookiebot sends its scanner through your website to find every cookie and tracker on it. To your analytics, that scanner looks like a handful of very thorough visitors who open every page in a day. Often GA4 leaves it out by itself. When it does not, you see a spike on the same day each month, with page counts and engagement that look nothing like your real visitors.
This guide shows how to recognise the scanner by its user agent and IP addresses, and the places where you can keep it out: in GA4, in your web container, in your server container, and with Measurebase.
What the scanner does
According to Cookiebot, each domain in your account is scanned every month, and on the free plan scans are started by hand. A scan can take up to 24 hours. It behaves like about five visitors browsing at the same time: it opens every subpage, follows links and menus, clicks buttons and plays embedded videos. It does not cache anything, so every page load fetches every resource again. The only thing it leaves alone is forms.
That is exactly what a cookie scan should do, and it is also why the traffic is easy to spot once you know the pattern: many page views from a few "users", spread over every page you have, with no conversions.
How to recognise it
By user agent. This is Cookiebot's own recommendation. Its scanner identifies itself with a string like this, where X stands for numbers that change:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko; compatible; Cookiebot/1.0; +http://cookiebot.com/) Chrome/X.X.X.X Safari/537.36
Because the full string can change, Cookiebot advises matching only on Cookiebot/1.0.
By IP address. Cookiebot scans from a small pool of static IPv4 addresses, published on its help center page Whitelisting the Cookiebot scanner. At the time of writing it lists eleven. Cookiebot states that a scan cannot come from any other address, and that the list on that page is always current. It does change, though, so use that page as the source, and follow it there to get an email when it is updated. We deliberately do not copy the list here: a copied list is the one that goes stale.
First check whether it is in your data
Cookiebot's help center says Google Analytics recognises the scanner and leaves it out of your reports. GA4 does exclude known bots automatically, based on Google's own research and the IAB's list of spiders and bots. You cannot switch that off, and GA4 does not show you how much it removed.
So look before you build anything. In Explore, make a free-form exploration with Date as the row and Views and Sessions as values, over at least three months. A spike that comes back on the same day every month, lining up with the date in Cookiebot's scan report email, is the scanner. A flat line means GA4 already handles it, and you can stop here.
Keep the scan complete
Whatever you choose, stop the scanner's data, not its tags. Cookiebot builds its cookie declaration from what the scan sees. If your tags no longer run for the scanner, the cookies they set are not seen either, and they can drop out of the declaration your banner shows visitors.
The options below that stop data after the browser tags have run (in GA4, in the server container, or with Measurebase) keep the scan complete. The web container option does not, which is why it comes last.
In GA4: an internal traffic rule
GA4's internal traffic rules match on IP address, which suits the scanner's fixed pool. (For your own office addresses, see how to exclude IP addresses in GA4.)
- Go to Admin › Data collection and modification › Data streams, open your web stream, then Configure tag settings › Show more › Define internal traffic › Create.
- Name the rule "Cookiebot scanner" and set the
traffic_typevalue to something of your own, such ascookiebot. - Add one condition per address from Cookiebot's list with the match type equals. Conditions are combined with OR. Cookiebot also publishes a ready regular expression for the whole pool, for the match type matches regular expression.
- Go to Admin › Data collection and modification › Data filters › Create filter, choose Internal traffic, set it to Exclude, enter the
traffic_typevalue from step 2 and leave the state on Testing. - During the next scan, check in Explore that the scanner's events carry your filter's name in the Test data filter name dimension. Then switch the filter to Active.
Know the limits. A filter only works from the moment it is active, never on past data, and what it excludes is gone for good, also from BigQuery. A property has at most ten data filters. You have to update the addresses when Cookiebot does. If your GA4 hits pass through a server container, use the Testing state to confirm the rule really matches before you rely on it. And with Measurebase's IP Anonymization switched on, GA4 receives addresses with the last part zeroed, so a rule for an exact address no longer matches: use one of the user agent options below instead.
In the server container: one condition
If you run a server container, this is the most reliable place. The scanner's browser still runs every tag, so the scan stays complete, and the data stops at your server before it reaches GA4.
Create a variable of the type Request Header with the header name User-Agent. Then create a trigger named "Cookiebot scanner" that fires on your GA4 client's events when that variable contains Cookiebot/1.0, and add it as an exception to your GA4 tag. Add the same exception to every other tag that forwards data, such as the Meta, TikTok or LinkedIn Conversions API tags, so the scan stays out of your ad platforms as well.
With Measurebase
Measurebase already recognises the scanner. Its user agent calls itself a bot, so bot detection counts it as Other bot on the Bot traffic panel of your Domain statistics page. A monthly scan shows up there as one tall bar on the scan day.
To act on it, you have three choices, all of which leave the browser tags running:
- One condition for every bot. With Data Enrichment on, every hit carries an
X-Device-Botheader,truefor the scanner. Make a Request Header variable for it and add the condition to your tags' triggers, and the same line keeps out Cookiebot and every other self-declared bot. - Bot Protection. This power-up stops measurement hits from the bot categories you choose before they reach your server container, while scripts keep loading. The scanner falls in the category Other bots.
- IP Filter. List Cookiebot's published addresses in IP Filter on the Power-ups page, and requests from them stop reaching your server container. The same staleness applies as in GA4: check the list when Cookiebot updates it.
In the web container: a user agent exception
Without a server container, you can stop the GA4 tags in the browser. Create a variable of the type JavaScript Variable with the global variable name navigator.userAgent. Create a Custom Event trigger with the event name .*, Use regex matching ticked, that fires when that variable contains Cookiebot/1.0, and add it as an exception to your Google tag and your GA4 event tags.
It works, and it is the only option here that changes what the scanner sees. Use it only when none of the others is available.
Which one to use
Match on the user agent, not the IP list: it is what Cookiebot recommends, and it does not go stale. With a server container, add the condition there, or let Measurebase's bot detection and Bot Protection handle every bot at once. Keep an IP rule in GA4 or IP Filter as a backup, and revisit it when Cookiebot updates its list.
Frequently asked questions
What are Cookiebot's scanner IP addresses?
Cookiebot publishes them on its help center page "Whitelisting the Cookiebot scanner": a pool of static IPv4 addresses, eleven at the time of writing. The list changes now and then; follow that page to be notified, and copy the current list from there rather than from older articles.
What is the Cookiebot user agent?
A Chrome-like string that contains Cookiebot/1.0; +http://cookiebot.com/. Cookiebot advises matching on Cookiebot/1.0 only, because the rest of the string can change.
Does GA4 filter out Cookiebot automatically?
Cookiebot says Google Analytics recognises its scanner, and GA4 excludes known bots by itself. You cannot see what GA4 removed, so check for a monthly spike in an exploration before you add your own filter.
Will excluding the scanner from GA4 affect my Cookiebot scan?
Not when you filter in GA4, in the server container or with Measurebase: the scanner still loads your pages and runs your tags. Blocking the scanner's addresses in a firewall or bot wall does stop the scan; Cookiebot's whitelisting page exists for exactly that case.
Can I remove past scanner traffic from GA4?
No. GA4 data filters apply from the moment they are active, never to data already collected. For past periods, leave the scan days out of the date range you report on.