Skip to content
Research
Skill

/bot-traffic-detection

Detect and filter automated bot spikes in Google Analytics 4. Patterns for datacenter ASN spikes, zero-second sessions, and single-page screenPageViews.

From plugin
google-analytics-mcp
24417 skills

Claude Code

$ npx -y skills add surendranb/google-analytics-mcp --skill bot-traffic-detection --agent claude-code

SKILL.md

bot-traffic-detection.SKILL.md
name: bot-traffic-detection
titleTag: "Identify & Filter Bot Traffic in Google Analytics 4"
description: "Detect and filter automated bot spikes in Google Analytics 4. Patterns for datacenter ASN spikes, zero-second sessions, and single-page screenPageViews."

Identify & Filter Bot Traffic in Google Analytics 4

Identify and exclude bot, scraper, crawler, and spam sessions from your Google Analytics 4 reporting to protect conversion rates and prevent skewed traffic baselines.

When to use

  • Traffic has unexplained spikes that don't correlate with marketing campaigns or product releases
  • Bounce rate is 0% or near-100% across hundreds of new sessions
  • Sessions show 0 seconds average engagement time with high screenPageViews
  • Referrers show unfamiliar domains, spam keywords, or suspicious TLDs
  • You need clean, validated baseline data before presenting quarterly numbers

Four Forensic Bot Signals

1. Zero-Second Engagement Distribution

Query sessions exhibiting zero or near-zero engagement duration:

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

**Bot indicators:** `userEngagementDuration` < 1.0 second, `screenPageViewsPerSession` exactly 1.0, and `bounceRate` at 1.0 (100%).

2. Suspicious Referral Sources & Ghost Domains

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

Flag and isolate any referral source where `userEngagementDuration / sessions` is under 2 seconds.

3. Invalid or Missing Hostnames

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

Scrapers and spambots frequently fire Google Analytics measurement tags without actually visiting your domain (hitting raw IP addresses, scraper staging proxies, or ghost hosts). Always verify that `hostname` matches your legitimate production domains.

4. Geographic & Datacenter Clustering

dimensions: ["country", "city", "sessionSource"]
metrics: ["sessions", "userEngagementDuration"]
order_by: sessions DESC

Clusters of hundreds of sessions originating from known datacenter hubs (e.g., Boardman, Ashburn, Council Bluffs) with zero engagement indicate automated cloud scraper runs rather than human browsing.

---

Filtering Strategy

While Google Analytics 4 excludes known IAB-registered bots automatically, headless crawlers and custom scrapers bypass default filters.

To filter suspected bot traffic in API queries, combine dimension and metric filters:

  • Exclude sessions where `userEngagementDuration` equals 0 and `screenPageViewsPerSession` equals 1.
  • Restrict `hostname` strictly to your verified production domain.

---

Three Prompts to Ask Your AI Agent

Copy-paste these prompts into Claude, Cursor, or Gemini CLI:

1. "Audit our traffic from the last 7 days for bot contamination. Check bounce rate, average session duration, and single-page sessions grouped by sessionSource."

2. "List all sessions grouped by hostname over the past 30 days. Flag any traffic hitting hostnames other than our primary domain."

3. "Show me cities generating more than 100 sessions over the last 14 days where average engagement duration was under 3 seconds."

How to Check Manually in the GA4 Console

1. Open **Reports → Acquisition → Traffic acquisition**. 2. Add a secondary dimension: click the **+** icon next to the primary column and choose **Geography → City**. 3. Sort by **Sessions** descending. 4. Scan the **Average engagement time per session** column. Any city generating hundreds of sessions with 0:00 engagement represents automated bot traffic.

Read more
@surendranb
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:

Stars on GitHub

Momentum

stars in total
244
Star history of surendranb/google-analytics-mcp on GitHub, a chart by star-history.com

Other skills on google-analytics-mcp.

More skills from other plugins.

academic-paper-review

academic-paper-review

Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints,…

deer-flow10d85k
@bytedance@bytedanceInstall Skill
last30days

last30days

Research what people actually say about any topic in the last 30 days. Pulls posts and engagement from Reddit, X, YouTube,…

@mvanhorn@mvanhornInstall Skill

Questions about bot-traffic-detection.

Which coding agents can use bot-traffic-detection?
bot-traffic-detection installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.