Come indagare sul traffico bot utilizzando Google Analytics

Investigate suspected bot traffic using Google Analytics

This guide provides a step-by-step process for using Google Analytics 4 (GA4) to help identify and investigate suspected bot activity.

1. Understanding GA4’s default bot filtering

GA4 automatically excludes traffic from known bots and spiders by default.[1] This filtering is based on Google’s research and the International Spiders & Bots List from the IAB.

The steps in this guide are meant to help you identify more sophisticated or unknown bots which may not be on this list.

2. Analyze traffic for unusual patterns

Bots often generate traffic which deviates significantly from your typical user patterns.

Steps:

  1. Check Realtime Reports:

    • Go to Reports > Realtime pages. Look for sudden, inexplicable spikes in “Active users in last 30 minutes.” This can be the first sign of an active bot uptick.

    :warning: If you think your site under a spam attack, use our guide on Immediate actions you can take during a spam attack

  2. Investigate the geographic location:

    • Go to Reports > Demographics > User > User attributes > Demographic details.

    • The default graph shown should be Demographic details: Country. Look for a high number of users from countries you don’t target, where you have no business presence, or where you’ve typically not gotten much traffic. A sudden surge from a single, unexpected location is a major red flag.

  3. Analyze traffic sources for referral spam:

    • Go to Reports > Acquisition > Traffic acquisition.

    • The report defaults to “Session default channel group.” Click the dropdown arrow next to the primary dimension and select Session source / medium. Scan for suspicious or nonsensical referral sources (e.g., "free-traffic-seo.com," “buttons-for-your-website.com”). These are classic signs of referral spam[2].

3. Scrutinize user behavior metrics

Behavioral metrics may be GA4’s strongest tool for separating human users from bots.

Steps:

  1. Look for low engagement time:

    • Go to Reports > Engagement > Pages and screens.

    :information_source: In GA4, Engagement rate is the percentage of sessions that lasted longer than 10 seconds, had a conversion event, or had at least 2 pageviews. This is a more nuanced view of the session than their previous ‘bounce rate’ measurement.

    • The Average engagement time metric shows how long your site was in the foreground for users. Bots typically spend very little time on a page. Sort the table by “Average engagement time” (ascending) to find pages with unusually low engagement despite significant views.

    • Look for pages with high “Views” but a very low “Engagement rate.” This indicates users are landing on the page and leaving immediately, a common bot behavior.

    :information_source: If you don’t see the “Engagement rate” column, you’ll need to add it. Click the pencil icon (Customize report) in the top-right corner, select “Metrics,” and add “Engagement rate” to the report. Remember to save your changes.

  2. Check landing pages:

    • Go to Reports > Engagement > Landing page.

    • In the left navigation, go to Reports > Engagement > Landing page. Look for pages with a high number of New users but extremely low Average engagement time. This pattern suggests automated traffic hitting specific entry points on your site and leaving right away.

4. What Google Analytics can’t tell you :frowning:

  • IP addresses: Like Google Search Console, Google Analytics does not report on user IP addresses. This information can only be found in your server logs. Analyzing server logs is critical for blocking malicious IPs.

Conclusion

While Google Analytics can be helpful in identifying suspicious traffic patterns, to slow down or block unwanted crawlers on a Discourse forum, you’ll need to adjust some of the settings you’ll find when you search for crawler under Admin > Site Settings.

For bots you choose to block completely, add their user agent to Blocked crawler user agents. For less aggressive, but still resource-intensive bots, you can add them to Slow down crawler user agents to reduce their crawling speed without blocking them entirely. You can manage the rate of the slow down through the Slow down crawler rate site setting.

:warning: Be very careful when making adjustments to these settings. For example, some site owners have accidentally blocked all traffic from legitimate search engines by misconfiguring this setting.

Finally though, remember that these measures are not foolproof. Crawlers are constantly evolving and may not be well-behaved; they may change their user agent strings or distribute requests across multiple IP addresses to bypass these limits. Therefore, while these settings can provide a strong first line of defense, you should continue to monitor your analytics and server logs for new or unusual patterns.


  1. [GA4] Known bot-traffic exclusion - Analytics Help ↩︎

  2. Referrer spam - Wikipedia ↩︎

Last edited by @MarkDoerr 2025-11-04T19:32:30Z

Last checked by @MarkDoerr 2025-11-04T19:33:05Z

Check documentPerform check on document: