agentleFS
surendranbsurendranb/google-analytics-mcp/skills/common-metric-names/SKILL.md

common-metric-names

Skill244 starsChanged 43 days agoMITView on GitHub

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.

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use these before calling get_ga4_data — wrong names return a hard error.

    line 8
  2. Very specific:

    If get_ga4_data returns "Invalid dimension" or "Invalid metric", do not guess alternatives.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Common Metric & Dimension Names

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.

Metrics — correct API names

What you meanWrong (will fail)Correct API name
Goal completions / conversions (RENAMED 2024)conversions, goals, conversionkeyEvents
Total usersusers, totalVisitorstotalUsers
Active users (rolling 30-day ≈ MAU)MAU, monthlyActiveUsers, activeVisitorsactive28DayUsers
Active users (rolling 7-day ≈ WAU)WAU, weeklyActiveUsersactive7DayUsers
Active users (rolling 1-day ≈ DAU)DAU, dailyActiveUsersactive1DayUsers
Distinct users in the queried rangeuniqueUsersactiveUsers
Page viewspageViews, pageviews, page_viewsscreenPageViews
E-commerce purchasespurchases, transactionsecommercePurchases
Product viewsitemViews, productViewsitemsViewed
Items added to cartaddToCarts, cartAddsitemsAddedToCart
Revenuerevenue, ecommerceRevenuepurchaseRevenue
Avg session durationavgSessionDuration, avgTimeOnSiteaverageSessionDuration
Total engagement timeengagementDuration, timeOnSiteuserEngagementDuration
Session key event rate (was "conversion rate", renamed 2024)conversionRate, goalConversionRate, sessionConversionRatesessionKeyEventRate
User key event rateuserConversionRateuserKeyEventRate
Engaged sessionsqualifiedSessions, validSessionsengagedSessions
Pages per sessionpagesPerSession, pageDepthscreenPageViewsPerSession

Dimensions — correct API names

What you meanWrong (will fail)Correct API name
Traffic channel groupsessionDefaultChannelGrouping, channelGroupingsessionDefaultChannelGroup
Landing page + querylandingPage (often wrong scope)landingPagePlusQueryString
Page pathpagePath, pagepagePath
Page path + querypagePathPlusQueryStringunifiedPagePathScreen
Session sourcesource (wrong scope — see attribution-scope skill)sessionSource
Session mediummedium (wrong scope)sessionMedium
Device typedevice, deviceTypedeviceCategory
Operating systemosoperatingSystem
BrowseruserAgentbrowser
Week of yearweek, weekNumberweek (this one IS correct)

Note on active users (MAU / WAU / DAU)

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.

Note on bounce rate

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.

When you hit a schema error

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.