ga4_run_report
Run custom Google Analytics 4 Data API reports with selected dimensions, metrics, filters, and sorting to retrieve report rows for analysis and reporting.
Instructions
Run any GA4 Data API report. Dimensions and metrics use API names (see ga4_metadata), e.g. dimensions ["eventName","platform"], metrics ["eventCount","totalUsers"]. Filters and orderBys use the Data API JSON shape. Requires: Google Analytics Data API (analyticsdata.googleapis.com) enabled on the quota project; Lector (Viewer) en la propiedad de GA4. If it fails for access, the error explains how to fix it; ga4_check_access checks everything at once.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max rows (default 1000) | |
| offset | No | Row offset for paging | |
| totals | No | Also return the total row | |
| metrics | Yes | Metric API names | |
| end_date | Yes | End date: YYYY-MM-DD, or relative like "today" | |
| property | No | Saved property name (see ga4_list_properties). Defaults to the default property. | |
| order_bys | No | Data API OrderBy list, e.g. [{"metric":{"metricName":"totalUsers"},"desc":true}] | |
| dimensions | No | Dimension API names | |
| start_date | Yes | Start date: YYYY-MM-DD, or relative like "7daysAgo", "yesterday", "today" | |
| metric_filter | No | Data API FilterExpression for metrics, e.g. {"filter":{"fieldName":"totalUsers","numericFilter":{"operation":"GREATER_THAN","value":{"int64Value":"100"}}}} | |
| dimension_filter | No | Data API FilterExpression for dimensions, e.g. {"filter":{"fieldName":"eventName","stringFilter":{"matchType":"BEGINS_WITH","value":"Checkout_"}}} |