How to Detect Bot Traffic in GA4 and BigQuery

How to Detect Bot Traffic in GA4 and BigQuery: BigQuery & data article cover from AnalyticsLiv

In short

GA4 automatically excludes known bots and spiders using Google research and the IAB list, and you cannot turn this off. Other bots still get through. Spot them by traffic spikes, near-zero engagement, odd referrers and locations, check row-level data with a simple BigQuery query, and block them at your firewall or CDN, not with GA4 data filters.

Contents7 sections

Talk to a specialist

Bot traffic inflates your metrics, skews your data and makes marketing decisions harder. GA4 already removes known bots automatically, but some automated traffic still gets through. This guide shows the signs of bot traffic, what GA4 filters for you, how to find the rest with GA4 and BigQuery, and how to block it at the source.

Why does detecting bot traffic matter?

  • Data distortion: inflated traffic gives a false picture of engagement and can lead to the wrong marketing decisions.
  • Attribution errors: bots can trigger events and key events, which makes it harder to see which channels really drive results.
  • Wasted resources: effort spent on traffic that looks high but comes from bots is better spent on real users.
  • Security risks: some bots are malicious and try to steal data, inject malware or disrupt your site.

Does GA4 filter bot traffic automatically?

Yes. GA4 automatically excludes traffic from known bots and spiders. It identifies them using Google's own research together with the IAB's International Spiders and Bots List. You cannot turn this exclusion off, and GA4 does not show how much known bot traffic was excluded.

What gets through are bots that aren't on those lists, so you still need to watch for the signs below.

What are the signs of bot traffic in GA4?

None of these is proof on its own, but together they are strong red flags:

  • Unusual traffic patterns: sudden spikes or dips, especially outside your normal business hours. Bots often run around the clock.
  • Very low engagement: sessions with almost no engagement time and a low engagement rate.
  • Referrals from unknown sources: a surge of traffic from unknown or suspicious referring sites.
  • Unlikely locations: a burst of traffic from countries or cities outside your target market.
  • Strange user activity: repetitive actions, such as the same clicks or the same page path, repeated in an unnatural way.

How do you find bot traffic in GA4?

  • Engagement reports and explorations: compare engagement rate, average engagement time and events per session by source, country and device. Bots usually show little or no engagement.
  • Custom dimensions: GA4 does not report the full user agent string. If you need it, send it (or other details such as screen resolution) as an event parameter from Google Tag Manager and register it as a custom dimension, then look for patterns.
  • Data filters are not bot filters: GA4 data filters exclude internal traffic (defined by IP address), developer traffic in debug mode and unwanted hostnames. They are meant for your own team's traffic, not for blocking bots, and excluded data is gone for good. Use report filters or comparisons if you only want to hide suspicious traffic from a view.

How do you check for bot traffic in BigQuery?

For row-level analysis, link GA4 to BigQuery (Admin > Product links > BigQuery links) and query the daily event export. The export includes device and browser fields (such as device.category and device.web_info.browser) and location fields (geo.country, geo.city), which GA4 derives from IP address. It does not include the IP address or full user agent string.

A simple check is to look for users with many page views but almost no engagement time:

SELECT
  user_pseudo_id,
  geo.country,
  device.web_info.browser,
  COUNTIF(event_name = 'page_view') AS page_views,
  SUM((SELECT value.int_value FROM UNNEST(event_params)
       WHERE key = 'engagement_time_msec')) AS engagement_ms
FROM `your-project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20261001' AND '20261031'
GROUP BY 1, 2, 3
ORDER BY page_views DESC
LIMIT 100;

Replace the project, dataset and dates with your own. Users near the top with hundreds of page views and little or no engagement time, often from one country or browser, are worth investigating. You can group the same query by traffic_source.source or by hour of event_timestamp to spot suspicious referrers and round-the-clock activity.

New to the export? See our guide to querying the GA4 BigQuery export.

How do you block bot traffic?

Stop bots before they reach your site and your tags:

  • Block at the source: use your firewall, CDN or bot-management tool to block known bad IP addresses and bot signatures.
  • Protect forms: use CAPTCHAs or other verification to stop bots submitting forms or completing actions.
  • Monitor continuously: bot activity changes, so check your traffic regularly for the signs above and adjust your rules.

Summary

GA4 removes known bots for you. For the rest, watch engagement, sources, locations and timing in GA4, dig deeper with a simple BigQuery query, and block bad traffic at your firewall or CDN rather than with GA4 data filters.

Frequently asked questions.

Ask us your own question

Yes. GA4 automatically excludes traffic from known bots and spiders, using Google research and the IAB International Spiders and Bots List. You cannot disable it or see how much was excluded.

Not really. GA4 data filters are for internal traffic defined by IP address, developer traffic and unwanted hostnames, and excluded data is permanently lost. Block bots at your firewall or CDN instead.

No. It includes location fields such as geo.country and geo.city, which GA4 derives from IP address, and browser and device fields, but not the IP address or full user agent string.

Need your marketing data in one place?

Talk to our data team about BigQuery pipelines and Looker Studio dashboards.