Skip to main content
Glama

SEO GSC Wizard MCP

GA4 custom dimension breakdown

query_ga4_custom_dimensions
Read-only

Use this when the user asks how GA4 traffic splits by one of the site's own event parameters or user properties. Breaks GA4 traffic down by ONE custom dimension registered on the property linked to a site (e.g. customEvent:source_format), optionally CROSSED with a second dimension, which is how a question like "which article sent how many readers to which page" is answered: primary customEvent:source_path, secondary customEvent:target_path, filtered to the one event that carries them. Metrics per row are eventCount, sessions, activeUsers and keyEvents, plus any registered custom metrics asked for; rows are sorted by eventCount, highest first. Not for standard dimensions such as channel, page or country: use query_ga4_report. Run list_ga4_custom_dimensions first for the exact names; an unregistered name is rejected here rather than silently returning an empty report. Returns a notConfigured result (not an error) when Google Analytics is not connected or no GA4 property is linked. Date range is optional: omit startDate/endDate to analyze the last 28 settled days (data lags ~2-3 days).

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of breakdown rows returned.
endDateNoOptional. Window end as YYYY-MM-DD (e.g. 2026-05-31). You do NOT need to know today's date or the latest available date: omit this and the server uses the latest settled Search Console date (data lags ~2-3 days behind today). Never pass null or the string "null".
filtersNoOptional GA4 dimension filters applied to every report in the call. Within a list field the values OR together; different fields AND together. Omit entirely for unfiltered data.
siteUrlYes
dimensionNoapiName of the custom dimension to break down by, from list_ga4_custom_dimensions (e.g. customEvent:source_format). Omit to use the property's first registered custom dimension; the response reports the choice.
startDateNoOptional. Window start as YYYY-MM-DD (e.g. 2026-05-03). You do NOT need to know today's date. Omit BOTH startDate and endDate to analyze the last 28 settled days automatically (Search Console data lags ~2-3 days). Never pass null or the string "null".
valueFiltersNoNarrow the whole report to rows whose custom dimension matches a value - the way to drill from "every source_path" into "the target pages of ONE source_path". Filters AND together.
customMetricsNoUp to 3 registered custom METRIC apiNames to add as extra columns (from list_ga4_custom_dimensions metricNames).
comparisonEndDateNoOptional. End of the comparison period as YYYY-MM-DD. Provide BOTH comparison dates to compare two periods; omit both for no comparison (prev* fields are then 0 and hasComparison false).
secondaryDimensionNoOptional second dimension to cross the first with, producing one row per PAIR of values. Either another custom dimension apiName, or one of: eventName, pagePath, landingPage, sessionDefaultChannelGroup, sessionSourceMedium, country, deviceCategory.
comparisonStartDateNoOptional. Start of the comparison period as YYYY-MM-DD. Provide BOTH comparison dates to compare two periods; omit both for no comparison (prev* fields are then 0 and hasComparison false).

Output Schema

NameRequiredDescriptionDefault
hintNo
noteNo
rowsNo
rangeNo
reasonNo
thenByNo
accountNo
listKeyNoName of the top-level field that holds the rows sortedBy describes.
metricsNo
siteUrlNo
summaryNoMetric totals keyed by GA4 metric name.
nextStepNo
orderingNo
rowCountNo
sortedByNo
timeZoneNo
dimensionNo
siteScopeNo
sortOrderNo
thenOrderNo
totalRowsNo
truncatedNo
dataSourceNo
propertyIdNo
prevSummaryNo
emptyBecauseNo
methodLimitsNo
hasComparisonNo
notConfiguredNo
reauthRequiredNo
comparisonRangeNo
availableMetricsNo
secondaryDimensionNo
availableDimensionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / listKey
      Added value: +{
      +  "$ref": "#/properties/siteUrl",
      +  "description": "Name of the top-level field that holds the rows sortedBy describes."
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / filters / properties / firstUserChannel
      Added value: +{
      +  "description": "GA4 firstUserDefaultChannelGroup names, matched exactly (any of): the channel that first acquired the user, as in GA4's User acquisition report, rather than the session's own channel. E.g. [\"Organic Search\"].",
      +  "items": {
      +    "maxLength": 256,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 300,
      +  "type": "array"
      +}
    • addedInput schema / properties / filters / properties / firstUserSourceMedium
      Added value: +{
      +  "description": "GA4 firstUserSourceMedium values, matched exactly (any of): the source / medium that first acquired the user (User acquisition report), e.g. [\"google / organic\"].",
      +  "items": {
      +    "maxLength": 256,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 300,
      +  "type": "array"
      +}
  3. Changed11 schema fields changed
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +true
    • addedOutput schema / properties / emptyBecause
      Added value: +{
      +  "$ref": "#/properties/siteUrl"
      +}
    • addedOutput schema / properties / methodLimits
      Added value: +{
      +  "$ref": "#/properties/siteUrl"
      +}
    • addedOutput schema / properties / nextStep
      Added value: +{
      +  "$ref": "#/properties/siteUrl"
      +}
    • addedOutput schema / properties / ordering
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "sortOrder": {
      +            "$ref": "#/properties/siteUrl"
      +          },
      +          "sortedBy": {
      +            "$ref": "#/properties/siteUrl"
      +          },
      +          "thenBy": {
      +            "$ref": "#/properties/siteUrl"
      +          },
      +          "thenOrder": {
      +            "$ref": "#/properties/siteUrl"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / range / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "days": {
      -        "type": [
      -          "number",
      -          "null"
      -        ]
      -      },
      -      "endDate": {
      -        "$ref": "#/properties/siteUrl"
      -      },
      -      "startDate": {
      -        "$ref": "#/properties/siteUrl"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "days": {
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "endDate": {
      +        "$ref": "#/properties/siteUrl"
      +      },
      +      "startDate": {
      +        "$ref": "#/properties/siteUrl"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / siteScope / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "hostnames": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "includesSubdomainsOf": {
      -        "$ref": "#/properties/siteUrl"
      -      },
      -      "note": {
      -        "$ref": "#/properties/siteUrl"
      -      },
      -      "sharedWithSites": {
      -        "$ref": "#/properties/siteScope/anyOf/0/properties/hostnames"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "hostnames": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "includesSubdomainsOf": {
      +        "$ref": "#/properties/siteUrl"
      +      },
      +      "note": {
      +        "$ref": "#/properties/siteUrl"
      +      },
      +      "sharedWithSites": {
      +        "$ref": "#/properties/siteScope/anyOf/0/properties/hostnames"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedOutput schema / properties / sortOrder
      Added value: +{
      +  "$ref": "#/properties/siteUrl"
      +}
    • addedOutput schema / properties / sortedBy
      Added value: +{
      +  "$ref": "#/properties/siteUrl"
      +}
    • addedOutput schema / properties / thenBy
      Added value: +{
      +  "$ref": "#/properties/siteUrl"
      +}
    • addedOutput schema / properties / thenOrder
      Added value: +{
      +  "$ref": "#/properties/siteUrl"
      +}
  4. Changed2 schema fields changed
    • changedInput schema / properties / filters / properties / hostName / description
      Previous value: -"GA4 hostName values, matched exactly (any of), e.g. [\"www.example.com\"]. When the linked GA4 property is shared with other sites, results are already limited to this site's hostnames (see `siteScope` in the response); setting hostName replaces that automatic scope, e.g. to read another stream or several hosts at once."New value: +"GA4 hostName values, matched exactly (any of), e.g. [\"www.example.com\"]. When the linked GA4 property is shared with other sites, results are already limited to this site's hostnames (see `siteScope` in the response). For the property owner, setting hostName replaces that automatic scope, e.g. to read another stream or several hosts at once; on a property shared with you it only narrows within the scope."
    • addedOutput schema / properties / reauthRequired
      Added value: +{
      +  "$ref": "#/properties/hasComparison"
      +}
  5. Changed6 schema fields changed
    • addedInput schema / properties / filters / properties / hostName
      Added value: +{
      +  "description": "GA4 hostName values, matched exactly (any of), e.g. [\"www.example.com\"]. When the linked GA4 property is shared with other sites, results are already limited to this site's hostnames (see `siteScope` in the response); setting hostName replaces that automatic scope, e.g. to read another stream or several hosts at once.",
      +  "items": {
      +    "maxLength": 256,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 300,
      +  "type": "array"
      +}
    • changedOutput schema / properties / availableDimensions / $ref
      Previous value: -"#/properties/metrics"New value: +"#/properties/siteScope/anyOf/0/properties/hostnames"
    • changedOutput schema / properties / availableMetrics / $ref
      Previous value: -"#/properties/metrics"New value: +"#/properties/siteScope/anyOf/0/properties/hostnames"
    • addedOutput schema / properties / metrics / $ref
      Added value: +"#/properties/siteScope/anyOf/0/properties/hostnames"
    • removedOutput schema / properties / metrics / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / siteScope
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "hostnames": {
      +          "anyOf": [
      +            {
      +              "items": {
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "includesSubdomainsOf": {
      +          "$ref": "#/properties/siteUrl"
      +        },
      +        "note": {
      +          "$ref": "#/properties/siteUrl"
      +        },
      +        "sharedWithSites": {
      +          "$ref": "#/properties/siteScope/anyOf/0/properties/hostnames"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  6. First observed

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds substantial context beyond the readOnly/openWorld annotations: unregistered names are rejected rather than returning an empty report, a notConfigured result is returned (as non-error) when GA4 is unlinked, and results are sorted by eventCount descending with a defined metric set. It does not cover the row-limit default or the ~28-day lag implication for comparison periods, but what it does disclose is high-value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the trigger condition and followed by behavior, exclusions, and caveats in a sensible order. It is dense and the example sentence is long, but for an 11-parameter tool with nested filters almost every clause carries information an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a complex nested-parameter tool with an output schema already documenting return shape, the description covers what the schema cannot: default date window and data lag, connectivity failure mode, prerequisite discovery step, and the primary/sibling split. Nothing needed for a correct first call is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 91%, yet the description still adds real semantics: the crossing pattern for secondaryDimension is grounded in a concrete example (source_path → target_path filtered to one event), the omit-and-default behavior of dimension is explained, and valueFilters is framed as the drill-down mechanism. That is meaning the schema alone does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('breaks GA4 traffic down by ONE custom dimension') and scopes it precisely to registered custom event/user/item dimensions. It explicitly separates itself from query_ga4_report for standard dimensions, so an agent can pick correctly without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Opens with the exact triggering question type, names the negative case ('Not for standard dimensions such as channel, page or country: use query_ga4_report'), and prescribes a prerequisite call to list_ga4_custom_dimensions. That is when-to-use, when-not-to-use, and prerequisite in one place.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources