ai-referral-analysis
How to track and measure traffic from ChatGPT, Claude, Perplexity, and Gemini in GA4. Exact dimension filters, regex patterns,…
How 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.
Claude Code
$ npx -y skills add surendranb/google-analytics-mcp --skill channel-acquisition --agent claude-code
Codex
$ npx skills add surendranb/google-analytics-mcp --skill channel-acquisition -a codex -y
Cursor
$ npx skills add surendranb/google-analytics-mcp --skill channel-acquisition -a cursor -y
Gemini CLI
$ npx skills add surendranb/google-analytics-mcp --skill channel-acquisition -a gemini-cli -y
GitHub Copilot
$ npx skills add surendranb/google-analytics-mcp --skill channel-acquisition -a github-copilot -y
OpenCode
$ npx skills add surendranb/google-analytics-mcp --skill channel-acquisition -a opencode -y
Windsurf
$ npx skills add surendranb/google-analytics-mcp --skill channel-acquisition -a windsurf -y
name: channel-acquisition titleTag: "GA4 Channel Acquisition: Default Grouping Rules" description: "How 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."
Analyze traffic sources, campaign media, and Default Channel Groups in Google Analytics 4. Determine which channels drive the highest volume, produce the longest engagement times, and deliver conversions.
Always use verified GA4 Data API field names:
| Acquisition Dimension | GA4 API Name | Notes | |---|---|---| | **Default Channel Group** | `sessionDefaultChannelGroup` | Organic Search, Direct, Paid Search, Referral, etc. | | **Source** | `sessionSource` | Specific entity (e.g., google, linkedin, newsletter) | | **Medium** | `sessionMedium` | Mechanism (e.g., organic, cpc, referral, email) | | **Source / Medium Combined** | `sessionSourceMedium` | Combined source and medium string | | **Campaign Name** | `sessionCampaignName` | UTM campaign parameter value | | **Campaign ID** | `sessionCampaignId` | Numeric ad campaign ID | | **Manual Ad Content** | `sessionManualAdContent` | `utm_content` parameter value |
> ⚠️ **Common Trap:** Never use `sessionDefaultChannelGrouping` (it does not exist). Always use `sessionDefaultChannelGroup`.
---
Rank acquisition channels by total sessions and visitor quality:
dimensions: ["sessionDefaultChannelGroup"]
metrics: ["sessions", "totalUsers", "newUsers", "userEngagementDuration",
"screenPageViewsPerSession", "bounceRate"]
date_range: last 30 days
order_by: sessions DESC---
Look beneath broad channel buckets to examine individual referring platforms:
dimensions: ["sessionSource", "sessionMedium"] metrics: ["sessions", "newUsers", "userEngagementDuration", "keyEvents"] date_range: last 30 days order_by: sessions DESC limit: 25
---
Evaluate performance across paid advertising channels:
dimensions: ["sessionCampaignName", "sessionDefaultChannelGroup"]
metrics: ["sessions", "newUsers", "keyEvents", "userEngagementDuration"]
dimension_filter: {
"filter": {
"fieldName": "sessionMedium",
"stringFilter": {"matchType": "EXACT", "value": "cpc"}
}
}
date_range: last 30 days
order_by: sessions DESC---
If traffic in the `Unassigned` channel group is growing, your UTM campaign tagging is malformed.
Query `sessionSource` and `sessionMedium` filtered specifically for `sessionDefaultChannelGroup = 'Unassigned'`. Common causes include:
---
Copy-paste these prompts into Claude Code, Cursor, or Gemini CLI:
1. "Break down our acquisition channels over the last 30 days. Report sessions, active users, engagement rate, and key events for each channel." 2. "List all sessions landing in the 'Unassigned' channel group over the past 60 days. Group by sessionSource and sessionMedium to identify malformed UTM tags." 3. "Compare the engagement duration and conversion rate of Paid Search versus Organic Search over the last 90 days."
1. Navigate to **Reports → Acquisition → Traffic acquisition**. 2. Review the `Session default channel group` table. 3. Click the blue **+** icon beside the primary column to add **Traffic source → Session source / medium** as a secondary dimension.
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:
How to track and measure traffic from ChatGPT, Claude, Perplexity, and Gemini in GA4. Exact dimension filters, regex patterns,…
Why session, user, and event metrics never match in GA4. Rules for pairing dimensions and metrics across user-scoped,…
Detect and filter automated bot spikes in Google Analytics 4. Patterns for datacenter ASN spikes, zero-second sessions, and…
Exact API field names for GA4 Data API queries. Avoid 400 errors from Universal Analytics names like ga:sessions or pageviews by…
Which dimensions and metrics can be queried together in GA4 without triggering incompatible scope errors. Matrix of user,…
Evaluate landing pages and blog content in GA4: screenPageViews, average engagement time, bounce rates, and organic search…
Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints,…
Research what people actually say about any topic in the last 30 days. Pulls posts and engagement from Reddit, X, YouTube,…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…
Search literature across sources, verify or manage citations, and build MeSH strategies or citation-impact audits. Use for…