ua-to-ga4
Skill244 starsChanged 43 days agoMITView on GitHub
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.
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 61
All GA4 API names are camelCase — never snake_case.
≈ “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.
Files
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.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- llms.txtllms.txt
- ga4-analyticsSkill
- ai-referral-analysisSkill
- attribution-scopeSkill
- bot-traffic-detectionSkill
- channel-acquisitionSkill
- common-metric-namesSkill
- compatible-combinationsSkill
- content-performanceSkill
- custom-dimensionsSkill
- date-rangesSkill
- ecommerce-analysisSkill
- filter-structuresSkill
- ga4-limitationsSkill
- gcp-setupSkill
- geo-device-segmentationSkill
- gcp-setupSkill
- traffic-diagnosisSkill
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
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.

