ai-referral-analysis
Measure traffic arriving from AI tools — ChatGPT, Claude, Perplexity, Gemini, Copilot, and others — and understand how it behaves…
Break down user behaviour by country, city, device category, and OS to understand regional patterns and optimise for your key markets.
$ npx -y skills add surendranb/google-analytics-mcp --skill geo-device-segmentation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/geo-device-segmentationContext preview
The summary Claude sees to decide when to auto-load this skill.
Break down user behaviour by country, city, device category, and OS to understand regional patterns and optimise for your key markets.
name: geo-device-segmentation description: "Break down user behaviour by country, city, device category, and OS to understand regional patterns and optimise for your key markets."
Break down user behaviour by country, city, device category, and OS to understand regional patterns and optimise for your key markets.
| Concept | GA4 API name | |---|---| | Country | `country` | | City | `city` | | Region | `region` | | Device category | `deviceCategory` | | Operating system | `operatingSystem` | | OS version | `operatingSystemVersion` | | Browser | `browser` | | Screen resolution | `screenResolution` | | Language | `language` |
Device category values: `desktop`, `mobile`, `tablet`.
dimensions: ["country"]
metrics: ["totalUsers", "sessions", "userEngagementDuration",
"screenPageViewsPerSession", "keyEvents"]
date_range: last 30 days
order_by: totalUsers DESC
limit: 20dimensions: ["deviceCategory"]
metrics: ["sessions", "totalUsers", "engagementRate",
"userEngagementDuration", "bounceRate"]
date_range: last 30 days
order_by: sessions DESCUnderstand device preferences by market:
dimensions: ["country", "deviceCategory"] metrics: ["sessions", "userEngagementDuration", "bounceRate"] dimension_filter: country IN [your top 5 countries from Step 1] date_range: last 30 days order_by: sessions DESC
Note: combining country + deviceCategory + additional dimensions in one query may exceed GA4's cardinality limit. Keep to 2–3 dimensions max.
For a specific country (e.g. Japan):
dimensions: ["city", "deviceCategory"]
metrics: ["sessions", "totalUsers", "userEngagementDuration", "keyEvents"]
dimension_filter: {
"filter": {
"fieldName": "country",
"stringFilter": {"matchType": "EXACT", "value": "Japan"}
}
}
date_range: last 30 days
order_by: sessions DESC
limit: 20dimensions: ["browser", "operatingSystem", "deviceCategory"] metrics: ["sessions", "bounceRate", "userEngagementDuration"] date_range: last 30 days order_by: sessions DESC limit: 20
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:
Measure traffic arriving from AI tools — ChatGPT, Claude, Perplexity, Gemini, Copilot, and others — and understand how it behaves…
GA4 has three distinct attribution scopes. Using the wrong scope gives misleading results. Choose based on the question you are…
Identify and exclude bot, scraper, and spam sessions from GA4 data.
Break down sessions and users by traffic source, medium, and channel group to understand where your audience comes from and which…
The correct GA4 Data API names for fields models most often get wrong. Use these before calling `get_ga4_data` — wrong names…
GA4 enforces strict rules about which dimensions and metrics can appear in the same request. Incompatible combinations return a…