Skip to content
Research
Skill

/ua-to-ga4

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

BOOST
From plugin
google-analytics-mcp
24317 skills
Install
$ npx -y skills add surendranb/google-analytics-mcp --skill ua-to-ga4 --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/ua-to-ga4

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

SKILL.md

ua-to-ga4.SKILL.md
name: ua-to-ga4
description: "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."

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` |

Key rules

All GA4 API names are camelCase — never snake_case.

| Wrong (snake_case) | Correct | |---|---| | `page_path` | `pagePath` | | `session_source` | `sessionSource` | | `device_category` | `deviceCategory` | | `event_name` | `eventName` | | `total_users` | `totalUsers` |

Attribution scope

GA4 splits attribution into three scopes. Use the right prefix:

| Scope | Prefix | Use for | |---|---|---| | Session | `session` (e.g. `sessionSource`) | Traffic acquisition analysis | | First user | `firstUser` (e.g. `firstUserSource`) | User acquisition analysis | | Event | `(none)` (e.g. `pagePath`) | Event-level analysis |

Mixing scopes causes 400 errors — see `compatible-combinations` skill.

Read more
Ships withgoogle-analytics-mcp

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:

Get the whole plugin

Other skills on google-analytics-mcp.