ai-referral-analysis
Measure traffic arriving from AI tools — ChatGPT, Claude, Perplexity, Gemini, Copilot, and others — and understand how it behaves…
How to find and query property-specific custom dimensions in GA4.
$ npx -y skills add surendranb/google-analytics-mcp --skill custom-dimensions --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/custom-dimensionsContext preview
The summary Claude sees to decide when to auto-load this skill.
How to find and query property-specific custom dimensions in GA4.
name: custom-dimensions description: "How to find and query property-specific custom dimensions in GA4."
How to find and query property-specific custom dimensions in GA4.
Custom dimensions are **property-specific**. Never guess their names. Always call `search_schema("custom")` first — it will show every registered custom dimension for this exact property.
GA4 supports two ways to access custom data:
**Registered custom dimensions** — appear in the schema by their registered name. Find them with `search_schema`. Use the name exactly as returned.
**Unregistered event parameters** — accessed inline with:
The `parameter_name` must exactly match what your tracking code sends. If the property has not collected this parameter, the API returns an error.
The model cannot know what custom parameters a GA4 property uses — they are defined by the site's own tracking code and GA4 Admin settings. `customEvent:page_category` works on one property and fails on another depending on whether that property's tracking sends a `page_category` parameter.
1. Call `search_schema("custom")` — lists all registered custom dimensions. 2. If the one you need appears, use its exact API name. 3. If it does not appear, ask the user what event parameter name their tracking code uses, then query with `customEvent:that_name`. 4. If the query still fails, the parameter is not collected by this property.
| Scope | Syntax | Use for | |---|---|---| | Event | `customEvent:name` | per-hit data (page category, product id, etc.) | | User | `customUser:name` | user attributes (plan, cohort, customer type) | | Session | registered name only | session-level custom groupings |
Mixing scopes can cause incompatibility errors — see the `compatible-combinations` skill.
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…