ua-to-ga4

ua-to-ga4 is a skill for Claude Code from surendranb/google-analytics-mcp. It costs 127 tokens per session (982 once invoked), scanned A, original, MIT.

A reference for translating Universal Analytics (UA) field names into the names used by Google Analytics 4 (GA4). UA was Google’s older analytics product, while GA4 is its replacement and uses different data fields.

In plain words
What is it for?
Find the correct GA4 Data API names for common metrics and dimensions such as users, page views, session duration, purchases, and revenue. It is useful when updating reports or code that was written for UA.
Why use it?
It prevents analytics queries from failing because they use retired UA names, including the change from “conversions” to “key events.”

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the google-analytics-mcp plugin — 16 skills, 1 MCP server shipped together

Good fit Find the correct GA4 Data API names for common metrics and dimensions such as users, page views, session duration, purchases, and revenue. It is useful when updating reports or code that was written for UA.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/surendranb/google-analytics-mcp/ua-to-ga4
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add surendranb/google-analytics-mcp --skill ua-to-ga4
Clone the repo
git clone --depth 1 https://github.com/surendranb/google-analytics-mcp

Made for: Claude Code.

Or install google-analytics-mcp, the plugin that ships this one along with the rest of its 16 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ua-to-ga4

README.md
[![agentmods](https://agentmods.dev/badge/skills/surendranb/google-analytics-mcp/ua-to-ga4/github.svg)](https://agentmods.dev/skills/surendranb/google-analytics-mcp/ua-to-ga4)
Your own site
<a href="https://agentmods.dev/skills/surendranb/google-analytics-mcp/ua-to-ga4"><img src="https://agentmods.dev/badge/skills/surendranb/google-analytics-mcp/ua-to-ga4/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ua-to-ga4

Your own site · 80×15
<a href="https://agentmods.dev/skills/surendranb/google-analytics-mcp/ua-to-ga4"><img src="https://agentmods.dev/badge/skills/surendranb/google-analytics-mcp/ua-to-ga4.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 127 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 982 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00127 $0.00982
Opus 5 $0.00063 $0.00491
Sonnet 5 $0.00025 $0.00196
Haiku 4.5 $0.00013 $0.00098

Measured 12d ago against content hash 23aeaedf92bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

ua-to-ga4 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ua-to-ga4/SKILL.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

UA to GA4 Field Name Mapping

Universal Analytics (UA) and GA4 use different names for equivalent concepts. UA was sunset on 2023-07-01; models trained before or around then guess UA field names that no longer exist in the GA4 Data API. On 2024-05-06 GA4 also renamed "conversions" to "key events" (see the conversions rows below). If a name feels obviously right but returns "Invalid metric/dimension", assume your training predates the change and verify with search_schema. This skill gives the correct GA4 Data API name for every common UA metric and dimension.

Metrics

UA name (wrong) GA4 API name (correct)
users totalUsers
uniquePageviews screenPageViews
pageviews screenPageViews
avgSessionDuration averageSessionDuration
timeOnPage / avgTimeOnPage userEngagementDuration
goalCompletionsAll / conversions keyEvents
goalConversionRateAll / conversionRate / sessionConversionRate sessionKeyEventRate
userConversionRate userKeyEventRate
transactions / purchases ecommercePurchases
transactionRevenue / revenue purchaseRevenue
revenuePerTransaction averagePurchaseRevenue
transactionsPerSession purchaseToViewRate
itemQuantity / itemViews itemsViewed
itemRevenue itemRevenue (same)
entrances sessions (no direct equivalent — use sessions)
pageValue no direct equivalent

Dimensions

UA name (wrong) GA4 API name (correct)
channelGrouping sessionDefaultChannelGroup
defaultChannelGrouping sessionDefaultChannelGroup
source sessionSource
medium sessionMedium
campaign sessionCampaignName
keyword sessionManualTerm
sourceMedium sessionSourceMedium
adContent sessionManualAdContent
pagePath pagePath (same)
pageTitle pageTitle (same)
landingPagePath landingPage
exitPagePath no direct equivalent
deviceCategory deviceCategory (same)
operatingSystem operatingSystem (same)
browser browser (same)
country country (same)
city city (same)
userType use newVsReturning

Read the full file on GitHub · 82 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 82 lines · 127 tokens per session scan A 23aeaedf92bf

Subscribe to this mod's changes

ua-to-ga4 is a skill published in the GitHub repository surendranb/google-analytics-mcp (241 stars, last pushed 2d ago), licensed MIT. It adds 127 tokens to every session and 982 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories