In GA4 reports for the webscraft.org website, sessions from a country where I have almost no readers started appearing. The share of such traffic was 26%. The sessions were short and very similar to each other, and GA4 considered them regular visitors. I checked the Cloudflare logs, and the picture became clearer. In this article, I'll explain how bots with headless browsers get into GA4, what signs to look for, and how to filter them out without breaking anything.
⚡ In Short: Why GA4 Doesn't See Some Bots
- ✅ GA4 Only Filters Out Known Bots. According to Google's help, traffic from known bots and spiders is automatically excluded based on Google's own research and the IAB list. You cannot disable this filter and see how much data it removes.
- ✅ A Bot Without JavaScript Doesn't Reach GA4, A Bot With a Browser Does. A headless browser executes the tag, so GA4 sees a regular session.
- ⚠️ GA4 Shows the Symptom, While Cloudflare Shows the Cause: network country, ASN, and request count.
- ⚠️ GA4 Data Filters Work Only Forward and cannot filter out countries or bots based on behavior. Blocking must be done at the Cloudflare level, carefully.
The total number of bots on the internet depends on the methodology. According to the 2026 Imperva report, bots account for over 53% of web traffic, and 40% of traffic is classified as malicious bots (last year Imperva reported 51% and 37%, this is data for 2024). Cloudflare counts differently: in June 2026, according to Cloudflare Radar, bots generated about 56% of requests, and these figures describe HTTP requests, not people or attention. In Radar's samples for all requests (Technology Checker overview), the proportion of bots is noticeably lower, around 35%. Imperva is a bot protection vendor, so its figures are best read as an industry benchmark. For a broader understanding of the problem's scale, see my article "The Internet Already Consists of 50% Bots".
📚 Table of Contents
🧠 How GA4 Decides It's a Human and What a Headless Browser Is
GA4 collects data through a JavaScript tag on the page. If the code doesn't execute, the event isn't sent, and the visit doesn't appear in the report. Therefore, simple scripts that only load HTML are not seen by GA4.
The only built-in protection is a list of known bots: Google uses its own research and the International Spiders and Bots List from IAB. This is a list of bots that identify themselves honestly, so it effectively filters out legitimate crawlers but is of little help against those who don't want to be recognized. One practical analysis puts it this way: built-in filtering only removes known crawlers and doesn't catch scraping via headless browsers.
What is a Headless Browser
It's a regular Chrome without a window. Chrome documentation describes headless mode as running a browser in an automated environment without a visible interface; it's controlled via Puppeteer, Playwright, or Selenium. The reasons for its use can vary:
- Legitimate: automated tests, availability monitoring, SEO crawlers, collecting public data.
- Undesirable: traffic manipulation, content scraping, ad fraud.
The key point for analytics: such a browser executes JavaScript, and therefore, it executes the GA4 tag, and the visit appears in the reports. Advanced bots can disguise themselves as regular users. I won't describe how they do it: this is an instruction for fraudsters, not a defense. The practical conclusion is simple: don't rely on a single tool; combine GA4, Cloudflare, and your advertising platform's data.
👻 Ghost Spam: Bots That Don't Even Visit the Site
Ghost spam doesn't open your pages. Events are sent directly to analytics servers via the Measurement Protocol, and strange sources and events that don't exist on the site appear in reports. This is a classic Universal Analytics problem.
In GA4, it's harder for a malicious actor: the Measurement Protocol requires a separately created API secret (Admin → Data Streams → Measurement Protocol), and official Google examples require both the measurement_id and the api_secret. Therefore, widespread ghost spam like in the UA era is not expected. However, some authors describe such hits in GA4 as well. If you see events that are not in your code, check if the api_secret could have been exposed in your public code, and if necessary, create a new one. This is my assumption, not a confirmed cause.
🔎 How I Identify Signs of Bots in GA4
When I analyze traffic in GA4, I don't draw conclusions based on a single metric. An isolated anomaly doesn't necessarily mean bots are visiting the site. I pay attention to a combination of signs:
- countries or cities with a high number of sessions but very low engagement;
- sessions lasting 0–1 second with only one page view;
- a sudden increase in the Direct channel share without an obvious reason;
- atypical screen resolutions or browser languages;
(not set) values in landing page reports;
- hundreds of sessions with almost identical behavior: the same user path and similar duration.
To determine where to start your investigation, you can use a practical guide to analyzing suspicious traffic spikes in GA4. It covers, among other things, average engagement time, returning user share, and Direct channel session share. I would consider these metrics as initial benchmarks, not as an independent method for detecting bots.
At the same time, I also consider the reverse risk: real users can also appear suspicious. For example, a person might use a VPN, access via a mobile network, or close a page within a second. Therefore, I don't consider anomalies in GA4 as proof of bot traffic – they are just a signal for further investigation of traffic sources, visitor behavior, and server logs.
🛡️ How to Confirm Suspicion in Cloudflare
GA4 doesn't show IP addresses and networks (ASNs), so the cause is sought where they are available. What to check:
- Security Events Log. According to Cloudflare documentation, basic metrics are available through Security Events on free and Pro plans, while Bot Analytics requires a Business plan or higher.
- Countries and ASNs. If suspicious requests come from data center networks, this is a strong argument for automated traffic. This conclusion is based on network logic, not documentation, so check your own data.
- Failed browser challenges (challenge).
- Requests without GA4 traffic. Compare the number of requests in Cloudflare with GA4 sessions. If there are significantly more requests, it's likely that some bots don't execute JavaScript and simply don't reach GA4.
| Capability |
GA4 |
Cloudflare |
| Sees bots without JavaScript |
No |
Yes (as requests) |
| Shows IP / ASN |
No |
Yes |
| Shows on-site behavior |
Yes |
No |
| Can block traffic |
No |
Yes |
Caveats About Countries
A high proportion of automated traffic from a specific country doesn't mean that bot operators live there. Commenting on Cloudflare Radar's regional breakdown, TechSpot notes that in Singapore and Iran, bots account for over three-quarters of requests, but this is more likely a reflection of hosting infrastructure, routing, VPNs, and other factors. Therefore, before blocking anything, check the ASN, not just the country.
🧪 My Case: Singapore and Cloudflare Journal
My blog has four language versions: Ukrainian, English, German, and Spanish. People read in English in Singapore, so real visitors from there are quite possible. However, in GA4, this country consistently ranks high in users, and their behavior differs from the rest. Below are two periods from the "Demographics → Country" report: summer 2026, when the strongest spikes occurred, and the last 28 days.
What I Saw in GA4: July–August 2026
| Country |
Active Users |
Engagement Rate |
Average Engagement Time per User |
| Singapore |
6,712 (30.16%) |
40.08% |
9 s |
| Ukraine |
2,622 (11.78%) |
82.32% |
1 min 21 s |
| USA |
2,412 (10.84%) |
62.43% |
1 min 14 s |
| Germany |
1,646 (7.4%) |
84.17% |
1 min 13 s |
| (not set) |
1,601 (7.2%) |
1.12% |
0 s |
| China |
1,262 (5.67%) |
72.19% |
28 s |
| Entire Site |
22,251 |
61.86% |
43 s |
What is visible for this period:
- Singapore is in first place by a large margin. About 30% of all active site users over two months, 2.5 times more.
- Traffic comes in waves. On normal days, there are dozens of users from Singapore, and then sharp spikes: several peaks of approximately 400–500 users per day at the end of July and the beginning of August, and a maximum on August 14.
- Peak on August 14: 932 active users from Singapore per day, out of 1,142 for the entire site. This is over 80% of the entire audience that day.
- Almost all users are new: 6,660 new out of 6,712 active.
- Short time on the site: 9 seconds versus 1 minute 11 seconds.
Such sharp spikes, as it seems to me, resemble automatic launches rather than organic reading. But this is only a sign, not proof.
What I See Now: Last 28 Days (September 18 — October 15, 2026)
| Country |
Active Users |
Engagement Rate |
Average Engagement Time per User |
| Singapore |
1,697 (25.93%) |
19.19% |
5 s |
| Ukraine |
1,090 (16.65%) |
80.94% |
2 min 11 s |
| Germany |
669 (10.22%) |
81.62% |
1 min 11 s s |
| USA |
646 (9.87%) |
59.04% |
1 min 15s |
| China |
340 (5.19%) |
27.09% |
35 s |
| (not set) |
249 (3.8%) |
2.42% |
0 s |
| Entire Site |
6,545 |
59.62% |
42 s |
The picture is similar, but calmer: Singapore is still first (25.93% of users, about a quarter of the audience), engagement is only 19.19% compared to 80.94% in Ukraine, time is 5 seconds, and the number of new users matches the number of active users (1,697 each). China has a similar profile (27.09%, 5 seconds) and entries without a country (2.42%, 0 seconds).
Why I Don't Claim It's Just Bots
In the summer, the engagement rate from Singapore was 40.08%, which is higher than now (19.19%), and GA4 recognized 2,693 sessions as engaged. Therefore, part of this traffic could have been real readers, for example, English speakers or those using VPNs, or bots that stayed on the page. GA4 metrics themselves do not distinguish this, so I consider the picture a suspicion, not proof.
My Hypothesis and Its Limits
Hypothesis: a significant part of "live" sessions from this country comes from cloud data center networks, meaning headless browsers. This is supported by the fact that Singapore, according to Cloudflare Radar, is among the countries with a very high proportion of automated traffic. But this is a correlation, not proof: I also cannot rule out that part of this traffic is real people through VPNs or corporate networks, so I have not completely blocked the country.
🧰 How to Filter Bots in GA4 (and What Filters Can't Do)
Expectations here are often high, so let's start with limitations:
- GA4 data filters are of only two types: internal traffic and developer traffic. You cannot exclude a country or "bots by behavior" with them.
- Internal traffic is determined by IP address. Theoretically, this can be used for specific IPs, but bots often change addresses, and an incorrect rule will affect real people, so I wouldn't rely on this method.
- Filters work only forward. As practitioners note, they are applied from the moment of creation and do not change historical data. Also, they remind that data collected during the filter's test mode is not processed retroactively.
What to Do Practically
- Analysis in Explorations. Create a Free form with dimensions "Country" and "Network/source," metrics "Sessions," "Engagement Rate," "Average Engagement Time." This way, you can see where the "live" traffic is and where it isn't.
- Comparison "before and after." Take a snapshot of metrics before changes in Cloudflare and compare after 1–2 weeks. Otherwise, you won't be able to distinguish the blocking effect from normal fluctuations.
- Segments without suspicious countries for reports — as a temporary analysis tool, not as data "cleaning."
Conclusion: To truly remove bots, not just hide them in reports, protection at the Cloudflare level is needed.
🧱 How to Block Bots in Cloudflare and What Not to Do
Cloudflare's feature names and tariff limitations change, so consult the current documentation before setting up.
Why robots.txt Is Not Enough for This
The first thing that comes to mind is to ban suspicious bots in robots.txt. But this file only asks bots not to enter certain sections, and only those who want to obey it. Standard RFC 9309 explicitly states that these rules are not a form of access authorization. Bots with headless browsers that mimic humans ignore it, so it doesn't work against them. For honest crawlers and scan budget management, the file is useful (I discussed this in the article "Robots.txt: A Complete Guide for SEO and Site Optimization"), but for bots that bother you, rules at the Cloudflare level are needed.
| Tool |
What it does |
Tariff |
| Bot Fight Mode |
Recognizes traffic by known bot patterns and issues a computational challenge |
Free |
| Super Bot Fight Mode |
Adds a whitelist of verified bots, actions by category, protection of static resources, JavaScript detection |
Pro, Business, Enterprise |
| Managed Challenge (WAF rule) |
Cloudflare itself decides whether to show a verification, depending on the risk |
All tariffs |
| Rate limiting |
Limits the number of requests from one address per period |
Depends on tariff |
How to Act Step-by-Step
- First, an exception for verified bots. Cloudflare directly advises not to block or "challenge" verified bots (Googlebot, Bingbot, monitoring services).
- Start with Managed Challenge, not blocking, and initially for a narrow condition (suspicious ASNs, not the whole country). This way, you will see the consequences and can roll back the rule.
- Monitor Security Events. See how many requests are "challenged" and whether regular visitors are disappearing.
- Pay attention to the Free tariff. According to practitioners' descriptions, Bot Fight Mode on Free works as a switch without exceptions, and more flexible settings are available in Super Bot Fight Mode.
- Check advertising after changes. Some authors warn that Bot Fight Mode can interfere with ad verification bots. This is the opinion of one publication, so contact your ad network's support if you see a decrease in impressions after the changes.
⚠️ What I Do Not Recommend Doing
When I deal with the problem of suspicious traffic, I do not recommend rushing with blocks. Incorrect rules can restrict access for real users or create problems with site indexing.
- I do not recommend blocking Googlebot and other verified search crawlers. Such restrictions can interfere with page scanning and negatively affect indexing. Before blocking a suspicious User-Agent, you should check who it actually belongs to.
- I do not recommend blocking an entire country without prior analysis. A high proportion of suspicious sessions from a certain region does not necessarily mean that all traffic from there is bots. The reason could be VPNs, cloud infrastructure, or automated requests. At the same time, you risk losing real readers, including those who use VPNs or are abroad. For example, in the section above about Singapore, I discuss why traffic geography alone is not sufficient grounds for blocking.
- I do not recommend abandoning GA4 solely due to bot traffic. Analytics helps identify anomalies and assess changes in visitor behavior. Instead of abandoning it, you should check traffic sources, data collection settings, and filtering capabilities. At the same time, it should be noted that GA4 does not automatically detect or filter all bot traffic.
- I do not recommend changing several blocking rules simultaneously. If you change Cloudflare rules, server filters, and other settings at the same time, it will be harder to determine which intervention yielded results. I would advise changing rules gradually, checking server logs, and comparing metrics before and after each change.
💸 Why This is Important for Advertising
For a publisher, bots are not just "dirty" statistics. Firstly, they distort sessions and metrics like RPM: the more empty sessions, the lower the revenue per session appears. Secondly, there is a risk to advertising itself. According to Google AdSense policies, traffic that artificially inflates advertiser costs or publisher revenue, including traffic generated by automated tools and bots, is considered invalid. With a high level of such traffic, Google may suspend or close an account, and if the quality of traffic cannot be verified, it may limit ad serving. There may also be a difference between preliminary and final revenue. Google separately reminds that the responsibility for traffic validity lies with the publisher, even if it is generated by a third party.
Practical advice: compare sessions in GA4 with data in your ad account (for me, it's Mediavine). A discrepancy in itself proves nothing, as platforms count traffic differently, but a sharp divergence along with other signs from the section above is a reason for investigation.
I wrote separately about the scale of click fraud and scammers' schemes: "Bot Farms: How Fake Reviews and Click Fraud Kill Honest Business". For information on how Google assesses invalid traffic on the AdSense side, see "How Google AdSense Anti-Fraud Works in 2025 and How to Increase RPM Without Getting Banned".
❓ Frequently Asked Questions (FAQ)
Why does GA4 show traffic from a country where I have no audience?
Most often, the reason is automatic traffic from cloud networks, VPNs, or proxies, and sometimes real visitors who use VPNs. Check the engagement of this traffic in GA4, and then the ASN and the number of requests in Cloudflare before drawing conclusions.
Can I disable or configure the bot filter in GA4?
No. Google explicitly states that excluding known bots cannot be disabled, nor can you see how much data has been filtered out.
Can I filter by country using GA4 data filters?
No. GA4 data filters only cover internal and developer traffic. For analysis, use Explorations and segments, and for actual blocking, use Cloudflare.
Do bot filters remove historical data?
No, filters only work forward. Old data is not recalculated, so compare periods before and after changes, rather than expecting the history to be "cleaned."
Is it worth blocking a country in Cloudflare?
Usually not. First, check the ASN and engagement. It is safer to apply a Managed Challenge to suspicious networks than to block a country entirely.
✅ Conclusions
- 🔹 GA4 only filters out known bots from its list, while bots with full browsers appear as regular visitors.
- 🔹 A single indicator (country, short session) proves nothing. Suspicion arises from a combination of several, and Cloudflare data confirms it: ASN, requests, browser checks.
- 🔹 GA4 data filters only cover internal and developer traffic and only work forward. Use Explorations for analysis.
- 🔹 Blocking should be done at the Cloudflare level: start with Managed Challenge for a narrow condition, do not touch verified bots, and do not block countries entirely.
- 🔹 For a publisher, this is also a matter of advertising risks: invalid traffic can lead to account restrictions.
- 🔹 The most reliable approach is to combine GA4, Cloudflare, and your advertising platform data, and check the results after each change.
📎 Sources
Important: Function names, Cloudflare tariff limits, GA4 interface, and bot statistics change. Before configuring, check the current rules in the official documentation. The conditions and data in this article are current as of October 2026.