/google-analytics-mcp:compatible-combinationsfrom google-analytics-mcp
Reference for valid GA4 dimension/metric pairings to avoid 400 incompatible-scope errors. Covers event, session, and user scope rules with common failure examples and safe universal dimensions.
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.
Google Analytics 4 enforces strict scoping boundaries. Attempting to query dimensions and metrics with conflicting scopes causes the API to return a 400 error: The request's dimensions & metrics are incompatible.
This reference outlines which field pairings are valid across event, session, and user scopes.
All data in GA4 is partitioned into three hierarchical scopes:
| Scope Level | Description | Key Dimensions | Key Metrics |
|---|---|---|---|
| Event Scope | Actions taken at a specific moment | eventName, pagePath, linkUrl | eventCount, screenPageViews, keyEvents |
| Session Scope | Attributes of a single visit | sessionDefaultChannelGroup, sessionSource | sessions, bounceRate, averageSessionDuration |
| User Scope | Lifetime attributes of an individual | firstUserDefaultChannelGroup, firstUserSource | totalUsers, newUsers, activeUsers |
| Dimension In Query | Incompatible Metric | What Fails | Valid Alternative |
|---|---|---|---|
sessionSource / sessionMedium | eventCount | Mixing session dimension with hit metric | Use sessions or engagedSessions |
eventName | sessions | Asking for session counts of an event | Use eventCount |
itemId / itemName | sessions or totalUsers | Item dimensions do not carry session scope | Use itemsViewed, addToCarts, itemsPurchased |
firstUserSource | sessions | Lifetime acquisition with session metric | Use newUsers or totalUsers |
promotionName | sessions | Promotion items are hit-scoped | Use promotionViews, promotionClicks |
Certain dimensions are universally compatible across almost all metrics:
date, month, year, weekcountry, city, regiondeviceCategory, operatingSystem, browserThese can be safely combined with event metrics (screenPageViews, eventCount), session metrics (sessions, bounceRate), and e-commerce metrics (purchaseRevenue).
When Google Analytics returns an incompatibility error, the API payload explicitly names the offending field:
Please remove eventCount to make the request compatible for example.
Follow the recommendation directly: remove the conflicting metric and replace it with a metric from the same scope as your dimensions.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub surendranb/google-analytics-mcp --plugin google-analytics-mcp17 skills in this plugin
/ai-referral-analysisHow to track and measure traffic from ChatGPT, Claude, Perplexity, and Gemini in GA4. Exact dimension filters, regex patterns, and channel comparison rules./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./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