How to Filter Bot Traffic in GA4 (What It Does for You and What It Doesn't)
To filter bot traffic in GA4, you first need to know what Google already removes for you: known bots and spiders are excluded automatically, and you can't switch that off. Everything else, such as scrapers posing as browsers, referral spam and your own test visits, is your job. This guide shows how to fingerprint the junk, hide it in reports with a reversible segment, and only then decide whether a permanent data filter is worth it.

What GA4 filters automatically, and what it doesn't
Google's help page on known bot traffic exclusion says GA4 identifies bots using "a combination of Google research and the International Spiders and Bots List" maintained by the IAB. Two details on that page matter: you can't disable the exclusion, and you can't see how much traffic was removed.
So "known" is the key word. A crawler that announces itself honestly gets dropped. A headless browser that runs your JavaScript and pretends to be Chrome on Windows usually doesn't. That's why a small site can still see a sudden wave of one-second sessions from a single city.
Here is how the work splits:
| Type of junk traffic | Handled by GA4 automatically? | What you can do |
|---|---|---|
| Declared crawlers on the IAB list | Yes, always | Nothing, it's already gone |
| Headless browsers and scrapers posing as users | No | Fingerprint, then segment out; block at the server or CDN |
| Your own visits and your developer's debug sessions | No, but there are built-in filters | Internal traffic and developer traffic data filters |
| Hits from other domains using your tag | No | Web hostname data filter |
| Spam domains showing up as referrals | No | Segment out; "unwanted referrals" only changes attribution |
One piece of good news for GA4 compared with the old Universal Analytics: sending events to GA4 from a server through the Measurement Protocol requires an api_secret, which the protocol reference marks as "Required." That makes the classic "ghost spam" sent without ever loading your site harder to pull off. Spam that actually loads your pages in a browser is another story.
How to identify bot traffic in Google Analytics: 6 fingerprints
Bots rarely look like people on more than one dimension at once. Look for traffic that matches several of these fingerprints:
- Zero engagement at volume. GA4 counts a session as engaged if it lasts longer than 10 seconds, has a key event, or has two or more page views, per Google's engagement rate definition. A source with hundreds of sessions and an engagement rate near zero is suspicious.
- One city, one browser, one screen size. Real audiences are messy. A spike where nearly all sessions share the same city, browser version and screen resolution is likely one machine or one data center.
- A sudden start and stop. Bots switch on overnight and vanish just as fast. Human growth curves are gradual, except after a mention or a newsletter.
- Direct or odd referrers. Bots usually arrive with no referrer, so they land in Direct, or with a spammy referral domain you've never heard of.
- Landing on pages nobody links to. Old URLs, the login page, or the same single post over and over.
- A hostname that isn't yours. If the Hostname dimension shows domains you don't own, someone is sending hits with your measurement ID.
None of these alone proves anything. A legitimate visitor from a small town on an old phone can trip two of them. Three or more together, at volume, is a pattern.
Step 1: Build a bot-hunting exploration (10 minutes)
Go to Explore → Free form and add:
- Dimensions: Date, Session source / medium, Country, City, Browser, Screen resolution, Hostname, Landing page + query string.
- Metrics: Sessions, Engaged sessions, Engagement rate, Average engagement time per session.
Put City and Browser in rows, Sessions and Engagement rate in values, and sort by Sessions. Set the date range to cover the suspicious period plus a few normal weeks before it. Then swap the row dimension: Screen resolution, Session source / medium, Hostname. You're looking for rows that combine high sessions with near-zero engagement.
Write the matching values down. You'll reuse them in the segment.
Step 2: Hide the bots with a reversible segment
A segment changes what you see, not what GA4 stores. Google's segment builder guide describes a segment as "a set of conditions used to filter the data in a report" and notes that segments apply to the date range you query. That makes segments the safe first step: if you get the conditions wrong, nothing is lost.
Three recipes that work well for small sites. Each one is a session segment with an exclude condition:
| Recipe | Exclude sessions where | Use when |
|---|---|---|
| Data-center fingerprint | City exactly matches X and Browser exactly matches Y and Screen resolution exactly matches Z | One combination accounts for a spike with near-zero engagement |
| Spam referrer | Session source contains the spam domain(s) | Unknown referral domains with zero engagement |
| Foreign hostname | Hostname does not exactly match your domain(s) | Hits from domains you don't own |
Combine conditions with AND, not OR. Excluding a whole city or a whole browser on its own also removes your real readers there. The narrower the fingerprint, the less real data you lose.
For standard reports, use comparisons, which "let you evaluate subsets of your data side by side." Building a comparison that excludes the fingerprint shows you the cleaned numbers next to the raw ones, which is useful when you have to explain a traffic jump to someone else.
Worked example (for illustration)
Imagine a cooking blog that normally gets around 150 sessions a day. One Tuesday it jumps to 900. In the exploration, 740 of those sessions come from a single city, all on the same Chrome version, at the same screen resolution, landing on the home page, with an engagement rate under 1%. The other 160 sessions look normal. A session segment excluding City + Browser + Screen resolution brings the day back to about 160, and the blogger sees that real traffic didn't change at all. These numbers are invented to show the method, not taken from a real site.
Step 3: Permanent filters, and when they're worth it
GA4 offers three types of data filters: developer traffic, internal traffic and web hostname traffic. Read the warning on that page before you activate anything: filters aren't retroactive, and "the effect on the data is permanent." Excluded data never reaches your reports or BigQuery. For data you only want hidden, Google itself points you to report filters instead.
Every data filter has three states, described in the internal traffic guide:
- Testing: matching data is labeled with the "Test data filter name" dimension but kept. This is where you check what the filter would remove.
- Active: the filter applies to incoming data and makes permanent changes.
- Inactive: the filter isn't evaluated.
The same page says a filter "can take between 24 - 36 hours to apply." Leave it in Testing for at least a few days of normal traffic before you switch it to Active.
Filter 1: your own visits (internal traffic)
In Admin → Data streams → your web stream → Configure tag settings → Define internal traffic, create a rule with your IP address or range. The rule sets a traffic_type parameter, internal by default, and the internal traffic data filter excludes events with that value. If your home IP changes often, this filter catches only part of your visits. Browsing your own site in a separate browser profile where you've opted out of analytics is a simpler habit.
Filter 2: developer traffic
This removes events sent in debug mode, so testing a new tag in DebugView doesn't inflate your numbers.
Filter 3: web hostname
If a scraper copied your site, tag included, its visits arrive in your property under its hostname. A hostname filter excludes those domains. Run the Hostname dimension over a long date range first and list every legitimate domain, including subdomains and a staging site if it shares the property, so you don't filter yourself.
A trick for persistent bot IPs
Because the internal traffic rule just stamps a traffic_type value on matching IPs, some site owners create a second rule with a different value, such as bot, for a stable bot IP range they've identified, plus a matching filter. It only works when the bot keeps the same IP or range. Most scrapers rotate addresses, so treat this as a niche tool, and test it first.
What "unwanted referrals" does and doesn't do
Many guides suggest adding spam domains to List unwanted referrals. Google's unwanted referrals article explains that this sets ignore_referrer=true, so the domain isn't displayed as a traffic source. The visits are not removed. They usually just move into Direct. It's the right tool for payment gateways and your own subdomains. It's the wrong tool for spam, because it hides where the junk comes from and still counts it.
Stop bots before they reach GA4
Analytics filtering is cleanup. Blocking at the edge reduces the junk itself, and saves server resources too. If your site runs through Cloudflare, Bot Fight Mode is available on the Free plan and challenges traffic that matches known bot patterns. Cloudflare's own page lists caveats: it applies to the whole domain, can't be skipped with custom rules, and may challenge API or app traffic. Check those before turning it on for a site with webhooks or a mobile app.
A WordPress security plugin with rate limiting does a similar job at a smaller scale. Neither replaces GA4 hygiene. They just mean less junk to filter.
Bot traffic filter checklist
- Accept that known bots are already gone and that you can't measure how many.
- Build one free-form exploration with City, Browser, Screen resolution, Source, Hostname and engagement metrics.
- Look for rows with high sessions and near-zero engagement that match three or more fingerprints.
- Exclude them with a narrow session segment (AND conditions) and compare against raw data.
- Set up internal and developer traffic filters, Testing first, Active after checking.
- Add a hostname filter only after listing every legitimate hostname.
- Don't use unwanted referrals for spam.
- Consider edge blocking if bots return every week.
Why clean numbers matter for small sites
On a large site, a few hundred bot sessions are noise. On a blog with 100 visits a day, they can double your traffic and flatten your engagement rate, which leads to bad decisions: chasing a post that "went viral" for a scraper, or quoting inflated numbers to an advertiser who later checks. For more on showing real traffic honestly, see how to prove your website traffic to advertisers. If you're new to GA4 in general, start with GA4 for bloggers, and if the spike turns out to be AI assistants rather than bots, here's how to track AI traffic in GA4.
What to do next
Run the exploration above today and see how much of last month was real. Then get an outside view: Satelo's free site check scores your site's quality from mostly open data and shows the evidence behind each number in about 30 seconds, so you can compare what GA4 says with what the outside world can see. Want to cross-check your numbers with other tools? See how to check website traffic for free.
FAQ
Does GA4 filter bot traffic automatically?
Yes, partly. GA4 automatically excludes known bots and spiders identified by Google research and the IAB International Spiders and Bots List. You can't turn this off and you can't see how much was excluded. Bots that pose as normal browsers can still get through.
How do I identify bot traffic in Google Analytics 4?
Look for sessions that match several fingerprints at once: near-zero engagement rate at high volume, a single city, browser and screen resolution, a sudden start and stop, Direct or unknown referral sources, and hostnames you don't own.
Can I exclude bot traffic from past GA4 data?
Not with data filters, because they only apply from the moment they're active. For past data, use an exclude segment in Explorations or a comparison in standard reports. Both hide the traffic without deleting anything.
Should I use unwanted referrals to block spam in GA4?
No. Unwanted referrals only stops a domain from being credited as a traffic source. The sessions still count and usually move into Direct, so the spam gets harder to see.
How do I exclude my own visits from GA4?
Define internal traffic by IP in your web data stream's tag settings, then create an internal traffic data filter. Keep it in Testing first, check the Test data filter name dimension, and switch it to Active once it catches only your visits.
Why does bot traffic show up as Direct in GA4?
Most bots arrive without a referrer or campaign parameters, and GA4 labels sessions without either as Direct. A sudden Direct spike with almost no engagement is one of the most common signs of bot traffic.
Read next




Check your site's Quality Score
Free, no sign-up: a 0–100 score from mostly open data. Then add your site to Satelo and get partner articles from sites of your level.
Enter a domain like example.com
Add my site