ai-referral-analysis
Measure traffic arriving from AI tools — ChatGPT, Claude, Perplexity, Gemini, Copilot, and others — and understand how it behaves…
The correct GA4 Data API names for fields models most often get wrong. Use these before calling `get_ga4_data` — wrong names return a hard error.
$ npx -y skills add surendranb/google-analytics-mcp --skill common-metric-names --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/common-metric-namesContext preview
The summary Claude sees to decide when to auto-load this skill.
The correct GA4 Data API names for fields models most often get wrong. Use these before calling `get_ga4_data` — wrong names return a hard error.
name: common-metric-names description: "The correct GA4 Data API names for fields models most often get wrong. Use these before calling `get_ga4_data` — wrong names return a hard error."
The correct GA4 Data API names for fields models most often get wrong. Use these before calling `get_ga4_data` — wrong names return a hard error.
> ⚠️ **YOUR TRAINING DATA IS OUTDATED**: Universal Analytics was sunset > 2023-07-01, and on 2024-05-06 Google Analytics 4 renamed all conversion metrics to **"key events"** > (`conversions` → `keyEvents`, `conversionRate` → `sessionKeyEventRate`). > Querying `conversions` will fail with an `Invalid metric` error. Always use `keyEvents`.
| What you mean | Wrong (will fail) | Correct API name | |---|---|---| | Goal completions / conversions (RENAMED 2024) | `conversions`, `goals`, `conversion` | `keyEvents` | | Total users | `users`, `totalVisitors` | `totalUsers` | | Active users (rolling 30-day ≈ MAU) | `MAU`, `monthlyActiveUsers`, `activeVisitors` | `active28DayUsers` | | Active users (rolling 7-day ≈ WAU) | `WAU`, `weeklyActiveUsers` | `active7DayUsers` | | Active users (rolling 1-day ≈ DAU) | `DAU`, `dailyActiveUsers` | `active1DayUsers` | | Distinct users in the queried range | `uniqueUsers` | `activeUsers` | | Page views | `pageViews`, `pageviews`, `page_views` | `screenPageViews` | | E-commerce purchases | `purchases`, `transactions` | `ecommercePurchases` | | Product views | `itemViews`, `productViews` | `itemsViewed` | | Items added to cart | `addToCarts`, `cartAdds` | `itemsAddedToCart` | | Revenue | `revenue`, `ecommerceRevenue` | `purchaseRevenue` | | Avg session duration | `avgSessionDuration`, `avgTimeOnSite` | `averageSessionDuration` | | Total engagement time | `engagementDuration`, `timeOnSite` | `userEngagementDuration` | | Session key event rate (was "conversion rate", renamed 2024) | `conversionRate`, `goalConversionRate`, `sessionConversionRate` | `sessionKeyEventRate` | | User key event rate | `userConversionRate` | `userKeyEventRate` | | Engaged sessions | `qualifiedSessions`, `validSessions` | `engagedSessions` | | Pages per session | `pagesPerSession`, `pageDepth` | `screenPageViewsPerSession` |
| What you mean | Wrong (will fail) | Correct API name | |---|---|---| | Traffic channel group | `sessionDefaultChannelGrouping`, `channelGrouping` | `sessionDefaultChannelGroup` | | Landing page + query | `landingPage` (often wrong scope) | `landingPagePlusQueryString` | | Page path | `pagePath`, `page` | `pagePath` | | Page path + query | `pagePathPlusQueryString` | `unifiedPagePathScreen` | | Session source | `source` (wrong scope — see attribution-scope skill) | `sessionSource` | | Session medium | `medium` (wrong scope) | `sessionMedium` | | Device type | `device`, `deviceType` | `deviceCategory` | | Operating system | `os` | `operatingSystem` | | Browser | `userAgent` | `browser` | | Week of year | `week`, `weekNumber` | `week` (this one IS correct) |
GA4 has no `MAU`, `WAU`, `DAU`, `monthlyActiveUsers`, or `dailyActiveUsers` metric — these hard-error. Use the rolling n-day metrics: `active1DayUsers` (≈ DAU), `active7DayUsers` (≈ WAU), `active28DayUsers` (≈ MAU). Each counts distinct users active in the N days *ending on that date* (a rolling window, not a calendar bucket). `activeUsers` = distinct users in the queried range. Never sum daily `activeUsers` across rows to get a period total — it double-counts users active on multiple days. For a monthly total, query `activeUsers` once over the whole range (no date dimension), or use `active28DayUsers` for a rolling month. Stickiness ratios `dauPerMau`, `dauPerWau`, `wauPerMau` are also available as metrics.
GA4 bounce rate = sessions with NO engaged session (opposite of GA3 logic). A bounce rate of 60% means 60% of sessions had no engagement — that is high. In GA3, bounce rate meant single-page sessions. Do not compare GA3 and GA4 bounce rates.
If `get_ga4_data` returns "Invalid dimension" or "Invalid metric", do not guess alternatives. Use `search_schema` with a keyword to find the correct name, or check this skill's table above.
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…
Identify and exclude bot, scraper, and spam sessions from GA4 data.
Break down sessions and users by traffic source, medium, and channel group to understand where your audience comes from and which…
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.