GA4 custom dimension breakdown
query_ga4_custom_dimensionsBreaks GA4 traffic down by ONE custom dimension registered on the property linked to a site (the site's own event parameters or user properties, 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. 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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of breakdown rows returned. | |
| endDate | No | Optional. 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". | |
| filters | No | Optional 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. | |
| siteUrl | Yes | ||
| dimension | No | apiName 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. | |
| startDate | No | Optional. 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". | |
| valueFilters | No | Narrow 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. | |
| customMetrics | No | Up to 3 registered custom METRIC apiNames to add as extra columns (from list_ga4_custom_dimensions metricNames). | |
| comparisonEndDate | No | Optional. 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). | |
| secondaryDimension | No | Optional 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. | |
| comparisonStartDate | No | Optional. 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
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | ||
| note | No | ||
| rows | No | ||
| range | No | ||
| reason | No | ||
| account | No | ||
| metrics | No | ||
| siteUrl | No | ||
| summary | No | Metric totals keyed by GA4 metric name. | |
| rowCount | No | ||
| timeZone | No | ||
| dimension | No | ||
| siteScope | No | ||
| totalRows | No | ||
| truncated | No | ||
| dataSource | No | ||
| propertyId | No | ||
| prevSummary | No | ||
| hasComparison | No | ||
| notConfigured | No | ||
| reauthRequired | No | ||
| comparisonRange | No | ||
| availableMetrics | No | ||
| secondaryDimension | No | ||
| availableDimensions | No |