GA4 pivot report
run_ga4_pivot_reportGA4 Data API runPivotReport: dimensions and metrics with one or more pivots (fieldNames, limit, offset, orderBys, metricAggregations), filters and comparisons. Returns Google's pivot headers and every row.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pivots": "<pivots>"
},
"name": "run_ga4_pivot_report"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | true returns Google's response exactly as Google sent it, unchanged. | |
| site | No | The site's domain (example.com) or its label. Optional when the account has exactly one site switched on. An unknown name returns an error that lists the switched on sites. | |
| limit | No | Rows to return, default 1000, up to Google's 250000. | |
| offset | No | Row offset for the next page. | |
| period | No | Date range. Default last_28_days. Named ranges end when the data is complete. | |
| pivots | Yes | GA4 Pivot objects, for example [{ "fieldNames": ["deviceCategory"], "limit": 5 }]. Google requires every requested dimension to appear in exactly one pivot's fieldNames. | |
| metrics | No | ||
| end_date | No | Custom end date YYYY-MM-DD. | |
| order_bys | No | GA4 OrderBy objects, for example [{ "metric": { "metricName": "sessions" }, "desc": true }]. | |
| dimensions | No | ||
| start_date | No | Custom start date YYYY-MM-DD. Overrides period. | |
| comparisons | No | GA4 Comparison objects (name plus dimensionFilter, or a saved comparison). | |
| date_ranges | No | Up to 4 GA4 date ranges. Dates are YYYY-MM-DD, today, yesterday or NdaysAgo. Overrides period. | |
| currency_code | No | ||
| metric_filter | No | GA4 FilterExpression applied to metrics after aggregation. | |
| keep_empty_rows | No | ||
| dimension_filter | No | GA4 FilterExpression for dimensions (andGroup, orGroup, notExpression, filter with stringFilter, inListFilter, numericFilter, betweenFilter, emptyFilter), as in the GA4 Data API. | |
| metric_aggregations | No | GA4 metricAggregations. Default TOTAL. |