Cookie preferences

Choose which optional cookies EndFrame may use on this site. Analytics and advertising tools load only if you allow them, and you can change your mind any time from “Cookie settings” in the footer. Whatever you choose, this tab keeps the campaign labels from the link that brought you, and they are saved with your account if you sign up. Read the Cookie Policy.

Needed for the site to work, such as remembering this choice. Always on.

Lets us load analytics tools through Google Tag Manager, including Google Analytics and Microsoft Clarity session recordings, to understand how the site is used.

Allows advertising tags to measure our ad campaigns. None run on this site today. It also keeps ad click IDs from the page address for this tab, and saves them with your account if you sign up.

Skip to main content

GA4 Bot Traffic: How to Spot It, Filter It and Keep It Out of Reports

A practical guide for marketers to GA4 bot and spam traffic: what Google already excludes, how to recognise bot sessions in an exploration, which data filters exist, and why the lasting fixes sit outside GA4.

The EndFrame Team7 min read

GA4 bot traffic is any session or event recorded in Google Analytics that was not produced by a person: crawlers, scrapers, uptime monitors, headless browsers and spam sent straight to your property. GA4 removes bots it already knows about, silently and without telling you how many. Everything else lands in your reports looking like real visits. The fix is a mix of reading reports carefully, one or two data filters, and blocking bots before they ever load your tag.

What GA4 already removes on its own

Google's help page on known bot-traffic exclusion says traffic from known bots and spiders is excluded automatically in every property. Google identifies them through its own research and the International Spiders and Bots List from the IAB (the Interactive Advertising Bureau). Two limits matter. You cannot turn this exclusion off, and you cannot see how much traffic it removed, so there is no report that says "300 bot sessions dropped yesterday".

A list can only catch bots that are known and identify themselves. Entries on the IAB list are added from submitted details such as user-agent strings and IP addresses, and the list is updated monthly. Automation that runs a normal-looking browser, rotates IP addresses or is brand new will pass straight through. That is why GA4 properties still see junk traffic even though bot filtering is always on.

Signs that a traffic spike is bots

No single signal proves a session is a bot. Several of these together, appearing suddenly, usually do:

  • A spike at odd hours for your audience, for example sessions jumping at 3am local time with nothing launched.
  • Average engagement time per session near zero and an engagement rate far below your normal level. GA4 counts a session as engaged if it lasts longer than 10 seconds, has a key event, or has two or more page or screen views.
  • Most of the new sessions coming from one city or one country you do not sell to.
  • One screen resolution or one browser version dominating the spike, which suggests the same automated setup running many times.
  • Session source / medium of (direct) / (none), or referrers you have never heard of.
  • Hostnames in the Hostname dimension that are not your domains, or that are blank.
  • Events arriving without page views, for example a custom event or a form event with no page_view in the same session.

Some of these overlap with ordinary tracking problems. Direct traffic in particular grows for many reasons that have nothing to do with bots, which our guide to why direct traffic is so high in GA4 works through. Low engagement on its own is not proof either: read engagement rate vs bounce rate before treating every short session as fake.

How to investigate bot traffic in a GA4 exploration

Standard reports show one or two dimensions at a time. A Free form exploration lets you line up the signals side by side:

  1. 1Open Explore and start a new exploration with the Free form template. Set the date range to cover the spike and a normal week before it.
  2. 2Import the dimensions Date, Hour, Hostname, City, Screen resolution, Browser and Session source / medium.
  3. 3Import the metrics Sessions, Engaged sessions, Average engagement time per session, Views and Key events.
  4. 4Put Date in rows and Sessions in values first, to confirm exactly which days are affected.
  5. 5Swap the row dimension to Hostname, then City, then Screen resolution, and look for one value that accounts for most of the extra sessions.
  6. 6When a pattern appears, add it as a filter in the exploration (for example City exactly matches the suspicious city) and check engagement time and key events for just those sessions.
  7. 7Compare the affected days with numbers bots cannot fake: orders in your shop platform, leads accepted in your CRM, or payments received.

The last step settles most arguments. Suppose a site normally records around 400 sessions a day and 12 orders. On one Tuesday GA4 shows 2,300 sessions, 1,900 more than usual, and almost all of the extra sessions are direct, from one city, with the same screen resolution and an average engagement time under one second. Orders that day are 12. The extra 1,900 sessions produced nothing a person would do, so you treat them as bots and stop reading the conversion rate for that day at face value.

What the spike looks likeLikely kind of bot trafficWhere the fix belongs
Your own hostname, page views recorded, near-zero engagement, one cityAutomated browsers loading your real pagesCDN or firewall bot rules, then read reports around the period
Hostnames that are not yours, or blank, often with no real pagesSpam sent to your measurement ID from elsewhereWeb hostname data filter
Events your server did not send, no matching browser sessionMeasurement Protocol spam with an exposed API secretReplace the API secret
Form events or key events with junk data behind themForm botsForm protection and stricter conversion rules

The data filters GA4 actually gives you

GA4 data filters live in Admin, under Data collection and modification, Data filters. Google's data filters page lists three types, and only one of them targets spam:

FilterWhat it removesUse it for bots?
Internal trafficTraffic from IP addresses you define as internalNo, it is for your own team. See how to exclude internal traffic in GA4
Developer trafficActivity from developers with debug mode switched onNo, it keeps testing out of reports
Web hostname trafficEvents by the hostname they were sent fromYes, for spam that does not come from your site

The hostname filter arrived in 2026. Google's What's new page announced it on 11 June 2026 as an Exclude filter, and on 21 September 2026 added Include filters, so you can keep an allowlist of approved domains instead of chasing each new spam hostname. Google notes that Include hostname filters do not apply to Measurement Protocol events, and that they automatically block events with an empty hostname, which it says typically indicates spam or abnormal traffic.

Filters are permanent. Google's documentation says a data filter works from the point it is created forward, does not affect historical data, and excluded data is never processed, so it will not reach GA4 or BigQuery later either. An Include filter that forgets your checkout domain, a landing page builder or a subdomain deletes that traffic for good. List every hostname that legitimately sends data first; our guide to GA4 subdomain tracking shows how to find them. Then test:

  1. 1In Admin, Data filters, select Create filter, then Web hostname traffic filter. You need the Editor role or above on the property.
  2. 2Give it a name of up to 40 characters, choose Exclude or Include only, pick a match type (exactly matches, begins with, ends with or contains) and enter the hostname.
  3. 3Set the filter state to Testing and save. Testing labels matching data instead of removing it.
  4. 4Wait 24 to 36 hours, then build a Free form exploration with the dimensions Test data filter name and Event name and the metric Event count, filtered to your filter's name.
  5. 5If only the hostnames you intended appear, change the state to Active. Google says an active filter starts filtering within 24 to 36 hours.

Fake events through the Measurement Protocol

The Measurement Protocol lets a server send events straight to GA4, authenticated with an API secret. Google's developer guide says the secret is private, must not appear in client-side code, and that exposing it lets unauthorised parties send arbitrary or spam data to your property. Because Include hostname filters skip these events, the secret is your main protection. If junk events appear that your own server did not send, treat the secret as exposed.

Google's help page on generating API secrets describes creating and deleting them, which is how you replace one. Go to Admin, Data streams, select the web stream, open Measurement Protocol API secrets and select Create. Put the new secret into your server or integration, confirm events still arrive, then open the More menu on the old secret's row and choose Delete. You need the Editor role, and each stream can hold up to 10 secrets. Our Measurement Protocol guide covers how legitimate server-side events should be sent.

What GA4 cannot do, and how to read around a bad period

The list of data filter types ends at the three above. There is no filter that excludes by user agent, by referrer or by city, and no way to delete sessions already recorded. The unwanted referrals setting only changes how a referrer is credited; it does not remove traffic. When a bot wave has already landed, work around it:

  • Report filters in standard reports (Add filter, at the top of the report) hide rows for that view without deleting data.
  • In explorations, build a segment that matches the bot pattern, such as one city plus one screen resolution, and look at results with and without it.
  • Annotate the affected dates for your team and leave them out of conversion rate comparisons.
  • Judge campaigns on key events and orders rather than sessions for that period, because bots inflate sessions far more than real outcomes.

Stopping bots before they reach GA4

Bots that load your real pages can only be stopped where your site is served. Most CDNs and hosting firewalls offer bot detection, challenge pages, rate limits and rules by country or network. A bot that never loads the page never runs the Google tag, so the data stays clean without any GA4 setting. These tools can also block useful crawlers and API traffic, so start with logging or a challenge rather than an outright block, and check that search engine crawlers and your payment provider's callbacks still get through.

Edge rules do nothing for spam sent directly to Google using your measurement ID, which is visible in your page source; that is the job of the hostname filter. Bots that fill in forms are a separate problem with separate fixes, covered in our guide to Google Ads spam leads.

Frequently asked questions

Can bot traffic in GA4 affect my Google Ads bidding?

Yes, if bots trigger an event you have marked as a key event and imported into Google Ads as a conversion. Bidding then learns from fake conversions. Check whether the suspicious sessions produced key events, and if they did, consider importing a conversion bots cannot easily fake, such as a completed purchase, instead of a page view or a raw form submission.

Can I undo a data filter after it is active?

You can stop it by changing its state to Inactive in Admin, Data filters, and Analytics then stops evaluating it for new data. Events it excluded while it was active do not come back, because Google says excluded data is never processed and never appears in reports or BigQuery. That is why every new filter should spend a day or two in the Testing state first.

Is bot traffic the reason my direct traffic is so high?

Sometimes, but usually not. Bots rarely send a referrer or campaign parameters, so they land in Direct. Most direct traffic, though, is real visitors whose source was lost, for example from untagged email links or in-app browsers. If the extra direct sessions are engaged and spread across many cities and devices, look at tagging rather than bots.

Try EndFrame

Add a server-side path for your conversions.

EndFrame collects events first-party and forwards conversions server-side to Meta, GA4, TikTok, and webhooks with event-ID deduplication — then credits each conversion to its campaign, with the visit-to-conversion path you can audit.

No credit card required

Keep reading