ai-referral-analysis
Measure traffic arriving from AI tools — ChatGPT, Claude, Perplexity, Gemini, Copilot, and others — and understand how it behaves…
Identify and exclude bot, scraper, and spam sessions from GA4 data.
$ npx -y skills add surendranb/google-analytics-mcp --skill bot-traffic-detection --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/bot-traffic-detectionContext preview
The summary Claude sees to decide when to auto-load this skill.
Identify and exclude bot, scraper, and spam sessions from GA4 data.
name: bot-traffic-detection description: "Identify and exclude bot, scraper, and spam sessions from GA4 data."
Identify and exclude bot, scraper, and spam sessions from GA4 data.
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%).
dimensions: ["sessionSource", "sessionMedium", "sessionDefaultChannelGroup"] metrics: ["sessions", "userEngagementDuration", "newUsers"] dimension_filter: sessionMedium = "referral"
Flag sources where `userEngagementDuration / sessions` < 2 seconds.
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.
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.
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.
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:
Measure traffic arriving from AI tools — ChatGPT, Claude, Perplexity, Gemini, Copilot, and others — and understand how it behaves…
GA4 has three distinct attribution scopes. Using the wrong scope gives misleading results. Choose based on the question you are…
Break down sessions and users by traffic source, medium, and channel group to understand where your audience comes from and which…
The correct GA4 Data API names for fields models most often get wrong. Use these before calling `get_ga4_data` — wrong names…
GA4 enforces strict rules about which dimensions and metrics can appear in the same request. Incompatible combinations return a…
Identify top-performing pages, find underperforming content, and understand engagement patterns across your site.