ai-referral-analysis
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, session-scoped, and event-scoped models.
Claude Code
$ npx -y skills add surendranb/google-analytics-mcp --skill attribution-scope --agent claude-code
Codex
$ npx skills add surendranb/google-analytics-mcp --skill attribution-scope -a codex -y
Cursor
$ npx skills add surendranb/google-analytics-mcp --skill attribution-scope -a cursor -y
Gemini CLI
$ npx skills add surendranb/google-analytics-mcp --skill attribution-scope -a gemini-cli -y
GitHub Copilot
$ npx skills add surendranb/google-analytics-mcp --skill attribution-scope -a github-copilot -y
OpenCode
$ npx skills add surendranb/google-analytics-mcp --skill attribution-scope -a opencode -y
Windsurf
$ npx skills add surendranb/google-analytics-mcp --skill attribution-scope -a windsurf -y
name: attribution-scope titleTag: "GA4 Attribution Scope: User vs Session vs Event" description: "Why session, user, and event metrics never match in GA4. Rules for pairing dimensions and metrics across user-scoped, session-scoped, and event-scoped models."
Google Analytics 4 features three distinct attribution scopes. Selecting the wrong scope produces distorted reports and misleading ROI conclusions. Choose your dimensions based on the specific business question you are answering.
| Scope | Dimension Prefix | Core Question | Standard GA4 Report | |---|---|---|---| | **Session Scope** | `session*` | Where did *this specific visit* originate? | **Traffic Acquisition** (Reports > Acquisition) | | **First-User Scope** | `firstUser*` | Which channel originally introduced this person? | **User Acquisition** (Reports > Acquisition) | | **Event / Cross-Channel** | *(no prefix)* | Which touchpoint receives credit for this conversion? | **Advertising / Attribution** (Explore > Attribution) |
---
*Pair with session metrics: `sessions`, `engagedSessions`, `bounceRate`, `averageSessionDuration`.*
*Pair with user metrics: `newUsers`, `totalUsers`, `userKeyEventRate`.*
*Pair with event and conversion metrics: `keyEvents`, `purchaseRevenue`.*
---
Use **Session Scope**. This tells you which channels are actively generating sessions today.
dimensions: ["sessionDefaultChannelGroup", "sessionSource"] metrics: ["sessions", "activeUsers", "engagementRate"] date_range: last 30 days
Use **First-User Scope**. This isolates the initial touchpoint that converted an anonymous person into a known visitor.
dimensions: ["firstUserDefaultChannelGroup", "firstUserSource"] metrics: ["newUsers", "activeUsers"] date_range: last 90 days
---
Consider a visitor who discovers your website via a LinkedIn post, returns two days later via an organic Google search, and buys a subscription.
In GA4:
Neither report is broken; they simply measure different stages of the customer journey. Always specify which scope you want your AI agent to examine.
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,…
Detect and filter automated bot spikes in Google Analytics 4. Patterns for datacenter ASN spikes, zero-second sessions, and…
How GA4 Default Channel Groups work, how to audit channel performance, and how to spot traffic falling into Unassigned or Direct…
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…