GA4 pivot report
run_ga4_pivot_reportBuild GA4 pivot tables to compare metrics across dimensions, such as sessions by channel and device, using the Data API.
Instructions
A GA4 pivot table, e.g. sessions by channel down the side and device across the top (Data API runPivotReport).
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": {
"dimensions": "<dimensions>",
"metrics": "<metrics>",
"pivots": "<pivots>"
},
"name": "run_ga4_pivot_report"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Site as a domain or Search Console URL, e.g. "example.com" or "sc-domain:example.com". Optional when the credentials see one site. | |
| period | No | Named date range ending on the last settled day. Default last_28_days. | |
| pivots | Yes | Each pivot lists dimensions (from dimensions) to lay out together. | |
| metrics | Yes | ||
| end_date | No | End date YYYY-MM-DD. Defaults to the last settled day (Search Console lags 2 to 3 days). | |
| dimensions | Yes | ||
| start_date | No | Start date YYYY-MM-DD. Overrides period. | |
| ga4_property | No | GA4 property ID (numbers only). Optional: found from the site's web stream when left out. | |
| dimension_filter | No | GA4 FilterExpression JSON. |