How to identify and filter bot traffic in GA4
Short answer
GA4 automatically excludes known bots and spiders, identified through Google research and the IAB/ABC International Spiders and Bots List. You cannot turn this off or see what it removed, and bots missing from the list still appear. Spot them by near-zero engagement, odd screen resolutions, one city and old browser versions, then exclude them with segments, IP-based data filters or by blocking them before the tag fires.
Google Analytics 4 counts whatever its tag reports, and a bot that runs JavaScript fires the tag the same way a browser does. The built-in filter only knows the bots on a list, so the rest of bot traffic lands in your sessions, conversion rates and remarketing audiences.
Does GA4 filter out bot traffic?
Partly. Google's known bot-traffic exclusion page says traffic from known bots and spiders is excluded automatically, using Google research and the International Spiders and Bots List maintained by the IAB. It also says you cannot disable the exclusion or see how much traffic it removed.
The list covers bots that declare themselves, such as search engine crawlers and monitoring services. A bot that presents itself as Chrome on Windows is on no list, so GA4 records it as a visitor.
Why do unknown bots still show up?
- Headless and automated browsers run the GA4 tag like any visitor.
- Bots sent by click fraud or fake sign-up campaigns land on your paid landing pages.
- Your measurement ID is visible in your page source, so anyone can send events to Google's collection endpoint with it without visiting your site. These hits often carry a hostname that is not yours.
How to identify bot traffic in GA4
Look for groups of sessions that differ from your normal visitors on several of these at once:
- Spikes in Direct traffic (Session default channel group) with near-zero engagement.
- Average engagement time per session close to zero, Views per session of exactly one, and no scroll events (GA4's enhanced measurement sends scroll when a visitor reaches 90% of the page).
- Screen resolution values that real devices rarely report, such as 800x600, the default window size of several automation tools.
- City concentrated on one place you never market to, or "(not set)".
- Browser version years out of date, or a single exact version far more common than in the rest of your traffic.
- Hostname values that are not your domains, which points to hits sent without a real visit.
- Device model and Operating system with version identical across hundreds of sessions.
GA4 does not show IP addresses, network owners or ASNs (the ID of the network an address belongs to). "All of this came from one hosting provider" can only be confirmed in server or CDN logs. How to detect bot traffic covers the log side.
Build an exploration to isolate the bots
In Explore, start a free-form exploration. Add Session default channel group, City, Screen resolution, Browser, Browser version and Hostname as dimensions, and Sessions, Engaged sessions, Average engagement time per session and Views per session as metrics. Find rows with high volume and almost no engagement, then build a session segment for that pattern, such as one city plus one screen resolution, and exclude it when reporting. Segments and comparisons change only what you see in that analysis: audiences, key events and the conversions you share with Google Ads still include the bots.
How to exclude bot traffic in GA4
Segments and comparisons. Useful for past data, with no change to collection.
Internal traffic rules and data filters. In the web data stream's tag settings, define internal traffic by IP address, exact or as a CIDR range (for example 203.0.113.0/24). GA4 then adds a
traffic_typeparameter, and a data filter excludes events with that value. Per the data filters help page, a property can have up to 10 filters, and data an active filter excludes is gone for good, so run it in Testing state first. This suits ranges you know, such as your office, uptime monitors or a bot range you confirmed in logs, which you can give its owntraffic_typevalue. Rotating bots will not stay inside a range.Unwanted referrals. Adding a domain to this list in tag settings stops it from being credited as a referral source. The sessions still count, so it does not remove bots.
Blocking at the edge. A bot that is blocked or challenged before the HTML is served never loads the tag, so it never reaches GA4 or your ad audiences. This Cloudflare custom rule expression matches visits from three large hosting networks (DigitalOcean, Amazon and Hetzner) while letting verified good bots through. Pair it with a managed challenge rather than a block, because some real people browse through VPNs hosted on those networks.
txt (ip.src.asnum in {14061 16509 24940} and not cf.client.bot)Server-side validation. With a server-side tagging container, events pass through your own endpoint first, so you can drop events that lack a session cookie your server set or that come from networks you have already flagged.
What GA4 cannot do
GA4 blocks nothing: a bot in your reports has already loaded the page, and the known bot list cannot be inspected. Kairal's guide to bot traffic in Google Analytics walks through cleaning reports alongside blocking.
Tools that help
StopBots is published by Kairal, which is one of the tools listed. The list is not a ranking.
- Cloudflare Bot Management scores and challenges bots at the edge, and the free plan includes a simpler Bot Fight Mode that is often enough for a small site.
- CrowdSec is open source and blocks IP addresses that its community has reported for abuse, a free option for self-hosted servers.
- Google Tag Manager server-side tagging routes analytics events through your own endpoint, where you can validate them before they reach GA4.
- Kairal runs at the CDN, reverse proxy or API with a JavaScript collector, and its preview mode shows which visitors it would challenge before you enforce anything.
Common questions
How do I remove bot traffic that is already in GA4?
You cannot delete it from standard reports, and data filters only act on data collected after they are active. For past data, use a segment or comparison that leaves out the bot pattern, or clean the raw events in the BigQuery export.
Can I see visitor IP addresses in GA4?
No. GA4 does not log or store IP addresses, so no report or export contains them. Find bot ranges in your server or CDN logs instead, where every request carries the client address.
Why does GA4 show a spike of traffic from one small town?
GA4 places visitors by IP address, and addresses owned by cloud data centres resolve to the town where the data centre sits. Ashburn in Virginia is a common example because it hosts a large concentration of data centres, so a spike from there with near-zero engagement is usually automated.