ai-referral-analysis
How to track and measure traffic from ChatGPT, Claude, Perplexity, and Gemini in GA4. Exact dimension filters, regex patterns,…
Segment GA4 data by country, city, device category, and browser. Spot localization opportunities and mobile conversion drops with ready queries.
Claude Code
$ npx -y skills add surendranb/google-analytics-mcp --skill geo-device-segmentation --agent claude-code
Codex
$ npx skills add surendranb/google-analytics-mcp --skill geo-device-segmentation -a codex -y
Cursor
$ npx skills add surendranb/google-analytics-mcp --skill geo-device-segmentation -a cursor -y
Gemini CLI
$ npx skills add surendranb/google-analytics-mcp --skill geo-device-segmentation -a gemini-cli -y
GitHub Copilot
$ npx skills add surendranb/google-analytics-mcp --skill geo-device-segmentation -a github-copilot -y
OpenCode
$ npx skills add surendranb/google-analytics-mcp --skill geo-device-segmentation -a opencode -y
Windsurf
$ npx skills add surendranb/google-analytics-mcp --skill geo-device-segmentation -a windsurf -y
name: geo-device-segmentation titleTag: "GA4 Geographic & Device Segmentation Analysis" description: "Segment GA4 data by country, city, device category, and browser. Spot localization opportunities and mobile conversion drops with ready queries."
Break down user behaviour by country, city, device category, and OS to understand regional patterns and optimise for your key markets.
Break down sessions, bounceRate, and userEngagementDuration by deviceCategory over the last 30 days. Highlight if mobile bounce rate is significantly higher than desktop.
Show my top 10 countries by totalUsers and sessions over the last 30 days, including engagementRate and keyEvents. Flag any countries where engagement is 20% below the average.
Query the top 15 cities in our primary market by sessions and keyEvents over the last 30 days. Show me where conversion concentration is highest.
| 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:
How to track and measure traffic from ChatGPT, Claude, Perplexity, and Gemini in GA4. Exact dimension filters, regex patterns,…
Why session, user, and event metrics never match in GA4. Rules for pairing dimensions and metrics across user-scoped,…
Detect and filter automated bot spikes in Google Analytics 4. Patterns for datacenter ASN spikes, zero-second sessions, and…
How GA4 Default Channel Groups work, how to audit channel performance, and how to spot traffic falling into Unassigned or Direct…
Exact API field names for GA4 Data API queries. Avoid 400 errors from Universal Analytics names like ga:sessions or pageviews by…
Which dimensions and metrics can be queried together in GA4 without triggering incompatible scope errors. Matrix of user,…
Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints,…
Research what people actually say about any topic in the last 30 days. Pulls posts and engagement from Reddit, X, YouTube,…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…
Search literature across sources, verify or manage citations, and build MeSH strategies or citation-impact audits. Use for…