custom-dimensions

custom-dimensions is a skill for Claude Code from surendranb/google-analytics-mcp. It costs 18 tokens per session (439 once invoked), scanned A, original, MIT.

A guide for finding and querying custom dimensions in GA4, Google's analytics platform. Custom dimensions are property-specific fields created from a site's own tracking data.

In plain words
What is it for?
Use it when building GA4 queries that need site-specific fields, such as custom event parameters or user properties.
Why use it?
It prevents queries from failing because of guessed field names. It explains how to inspect the property's schema and how to query registered dimensions or unregistered event and user values.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the google-analytics-mcp plugin — 16 skills, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/surendranb/google-analytics-mcp/custom-dimensions
Any agent
npx skills add surendranb/google-analytics-mcp --skill custom-dimensions
Clone the repo
git clone --depth 1 https://github.com/surendranb/google-analytics-mcp

Made for: Claude Code.

Or install google-analytics-mcp, the plugin that ships this one along with the rest of its 16 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for custom-dimensions

README.md
[![agentmods](https://agentmods.dev/badge/skills/surendranb/google-analytics-mcp/custom-dimensions.svg)](https://agentmods.dev/skills/surendranb/google-analytics-mcp/custom-dimensions)
Your own site
<a href="https://agentmods.dev/skills/surendranb/google-analytics-mcp/custom-dimensions"><img src="https://agentmods.dev/badge/skills/surendranb/google-analytics-mcp/custom-dimensions.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 439 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00439
Opus 5 $0.00009 $0.00219
Sonnet 5 $0.00004 $0.00088
Haiku 4.5 $0.00002 $0.00044

Measured 6d ago against content hash 654f4f8abda3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

custom-dimensions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/custom-dimensions/SKILL.md · 53 lines

What it actually says

Custom Dimensions and Event Parameters

How to find and query property-specific custom dimensions in GA4.

The core rule

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.

Two valid syntaxes

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:

  • customEvent:parameter_name for event-scoped parameters
  • customUser:property_name for user-scoped properties

The parameter_name must exactly match what your tracking code sends. If the property has not collected this parameter, the API returns an error.

Why guessing fails

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.

Workflow

  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 matters

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.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 53 lines · 18 tokens per session scan A 654f4f8abda3

Subscribe to this mod's changes

custom-dimensions is a skill published in the GitHub repository surendranb/google-analytics-mcp (241 stars, last pushed 4d ago), licensed MIT. It adds 18 tokens to every session and 439 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories