run_pivot_report
Run official GA4 pivot reports with validated axes to break down metrics by dimensions, date ranges, filters, and ordering. Returns pivot headers, rows, aggregates, and quota for analysis.
Instructions
Run an official GA4 pivot report with validated pivot axes.
Args: property_id: Numeric property ID or properties/ID. report: ReportSpec: date_ranges, dimensions and metrics plus optional filters, currency_code, keep_empty_rows and return_property_quota. Use pivot-level limit, offset and order_bys, not report-level ones. pivots: Non-empty list of PivotSpec objects: field_names and positive limit required; offset, order_bys and metric_aggregations optional. Each selected dimension must occur in exactly one axis; dateRange may additionally be used for multiple date ranges. Product of limits must be <=250000.
Returns: Official pivot_headers, metric_headers, rows, aggregates, metadata and quota. Read rows using pivot_headers; they are not flattened or summed.
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": {
"property_id": "<property_id>",
"report": "<report>",
"pivots": "<pivots>"
},
"name": "run_pivot_report"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pivots | Yes | ||
| report | Yes | A single core report; field names use Data API snake_case. | |
| property_id | Yes | Numeric GA4 property ID or properties/ID; metadata property 0 is universal |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | ||
| aggregates | No | ||
| pivot_headers | No | ||
| metric_headers | No |