Skip to content
Research
Skill

/bot-traffic-detection

Identify and exclude bot, scraper, and spam sessions from GA4 data.

BOOST
From plugin
google-analytics-mcp
24317 skills
Install
$ npx -y skills add surendranb/google-analytics-mcp --skill bot-traffic-detection --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/bot-traffic-detection

Context preview

The summary Claude sees to decide when to auto-load this skill.

Identify and exclude bot, scraper, and spam sessions from GA4 data.

SKILL.md

bot-traffic-detection.SKILL.md
name: bot-traffic-detection
description: "Identify and exclude bot, scraper, and spam sessions from GA4 data."

Bot Traffic Detection

Identify and exclude bot, scraper, and spam sessions from GA4 data.

When to use

  • Traffic has unexplained spikes that don't correlate with any activity
  • Bounce rate is 0% or near-100% across many sessions
  • Sessions show 0 engagement time but high pageview counts
  • Referrers look suspicious (random domains, unrecognised TLDs)
  • You want to establish a clean baseline before any analysis

How to detect

Step 1 — Check engagement time distribution

Query sessions with very low or zero engagement:

dimensions: ["sessionDefaultChannelGroup", "sessionSource", "sessionMedium"]
metrics: ["sessions", "userEngagementDuration", "bounceRate", "screenPageViewsPerSession"]
date_range: last 7–14 days

Bot signals: `userEngagementDuration` near 0, `screenPageViewsPerSession` exactly 1, `bounceRate` at 1.0 (100%).

Step 2 — Inspect referrer sources

dimensions: ["sessionSource", "sessionMedium", "sessionDefaultChannelGroup"]
metrics: ["sessions", "userEngagementDuration", "newUsers"]
dimension_filter: sessionMedium = "referral"

Flag sources where `userEngagementDuration / sessions` < 2 seconds.

Step 3 — Check hostname

dimensions: ["hostname"]
metrics: ["sessions", "screenPageViews"]

Bot traffic often hits unexpected hostnames (staging domains, raw IPs, or hostnames you don't own). Filter to your known production hostnames.

Step 4 — Geographic anomalies

dimensions: ["country", "city", "sessionSource"]
metrics: ["sessions", "userEngagementDuration"]
dimension_filter: country = [countries with no expected traffic]

Clusters of sessions from unexpected countries with 0 engagement = bot signal.

Exclusion approach

GA4 does not have a native bot filter toggle beyond the automatic Google filter. To exclude suspected bot traffic from your analysis, add a dimension filter:

dimension_filter: {
  "filter": {
    "fieldName": "sessionDefaultChannelGroup",
    "stringFilter": {"matchType": "EXACT", "value": "Direct"}
  }
}

…combined with a metric filter on `userEngagementDuration > 0`.

Note: GA4 already filters known bots automatically. What remains are unknown/new bots and scrapers that mimic real browser behaviour.

What to report

  • Total suspicious sessions as % of all sessions
  • Top suspicious sources with their engagement metrics
  • Whether the pattern is new (spike) or chronic (baseline contamination)
Read more
Ships withgoogle-analytics-mcp

Model Context Protocol (MCP) server for Google Analytics 4: real-time query exploration, schema discovery, metric aggregation, and audience insights for AI agents. 🌐 Live Documentation & Web Portal:

Get the whole plugin

Other skills on google-analytics-mcp.