/google-analytics-mcp:ai-referral-analysisfrom google-analytics-mcp
Tracks and measures traffic from AI assistants (ChatGPT, Claude, Perplexity, Gemini) in GA4 using exact dimension filters, regex patterns, and channel comparison rules.
Ships in google-analytics-mcp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Measure traffic arriving from generative AI assistants — ChatGPT, Claude, Perplexity, Gemini, Microsoft Copilot, and others — and understand how AI-driven discovery behaves compared to organic search and direct traffic.
These domains appear in GA4 under the sessionSource dimension when users click links cited inside AI chat windows:
| AI Platform | Source Domains (sessionSource) | Default Channel Group |
|---|---|---|
| ChatGPT | chatgpt.com, chat.openai.com | AI Assistant or Referral |
| Claude | claude.ai | AI Assistant or Referral |
| Perplexity | perplexity.ai | AI Assistant or Referral |
| Google Gemini | gemini.google.com | AI Assistant or Referral |
| Microsoft Copilot | copilot.microsoft.com, bing.com | AI Assistant or Organic Search |
| You.com | you.com | Referral |
| Grok | grok.x.ai, x.com | Referral or Organic Social |
Note on Native GA4 Tracking: Google Analytics 4 includes an AI Assistant channel within the Default Channel Group for major platforms. However, traffic from new AI browsers or unclassified models frequently lands under generic
ReferralorDirect. Filtering bysessionSourceguarantees complete coverage.
Track total volume and trajectory over time:
dimensions: ["date", "sessionSource"]
metrics: ["sessions", "newUsers", "userEngagementDuration", "screenPageViews"]
dimension_filter: sessionSource contains "chatgpt.com" OR "perplexity.ai" OR
"claude.ai" OR "gemini.google.com" OR "copilot.microsoft.com"
date_range: last 30–90 days
Plotting date against sessions reveals whether AI traffic is expanding month-over-month.
Compare visitor engagement quality between AI referrals and your standard channels:
dimensions: ["sessionDefaultChannelGroup", "sessionSource"]
metrics: ["sessions", "userEngagementDuration", "screenPageViewsPerSession",
"keyEvents", "bounceRate"]
date_range: last 30 days
Filter results to AI sources and evaluate:
Discover which URLs AI models cite most frequently:
dimensions: ["sessionSource", "landingPage"]
metrics: ["sessions", "userEngagementDuration", "keyEvents"]
dimension_filter: sessionSource contains "chatgpt.com" OR "perplexity.ai" OR "claude.ai"
date_range: last 30 days
order_by: sessions DESC
This pinpoints the exact documentation, articles, or product pages driving AI search citations.
Once connected to GA4 MCP, you can copy-paste these prompts directly into Claude, Cursor, or Gemini CLI:
1. "Show all referral traffic from AI platforms (ChatGPT, Claude, Perplexity, Gemini) over the last 90 days. Report monthly sessions, active users, and average engagement duration per source."
2. "Compare the engagement quality of AI assistant traffic against traditional Organic Search for the past 30 days. Show bounce rate, session duration, and key events per session."
3. "Which specific landing pages are AI assistants citing? List the top 10 landing pages for chatgpt.com and perplexity.ai over the last 60 days sorted by sessions descending."
chatgpt.com or perplexity.ai to view immediate session totals.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ga4, ai-traffic, referral-analysis, geo, generative-engine-optimization
npx claudepluginhub surendranb/google-analytics-mcp --plugin google-analytics-mcp17 skills in this plugin
/attribution-scopeWhy session, user, and event metrics never match in GA4. Rules for pairing dimensions and metrics across user-scoped, session-scoped, and event-scoped models./bot-traffic-detectionDetect and filter automated bot spikes in Google Analytics 4. Patterns for datacenter ASN spikes, zero-second sessions, and single-page screenPageViews./channel-acquisitionHow GA4 Default Channel Groups work, how to audit channel performance, and how to spot traffic falling into Unassigned or Direct due to broken UTM parameters./common-metric-namesExact API field names for GA4 Data API queries. Avoid 400 errors from Universal Analytics names like ga:sessions or pageviews by using valid GA4 schema./compatible-combinationsWhich dimensions and metrics can be queried together in GA4 without triggering incompatible scope errors. Matrix of user, session, and event-level pairings./content-performanceEvaluate landing pages and blog content in GA4: screenPageViews, average engagement time, bounce rates, and organic search conversions per URL.Other plugins' skills for the same job