ga4_run_report
Run Google Analytics 4 standard reports using dimensions, metrics, date ranges, filters, ordering, and pagination. Reports include sampling, threshold, and quota metadata to inform data quality.
Instructions
Run a GA4 standard report. The workhorse tool.
Args: property_id: numeric or 'properties/NNN'. dimensions: list of dimension api_names (e.g. ["country", "deviceCategory", "date"]). Custom dims require 'customEvent:' or 'customUser:' prefixes. metrics: list of metric api_names (e.g. ["activeUsers", "sessions", "totalRevenue"]). date_ranges: list of {start_date, end_date, name?}. Accepts 'YYYY-MM-DD', 'NdaysAgo', 'today', 'yesterday'. Up to 4 ranges. dimension_filter / metric_filter: filter expression dicts. Shapes: {"filter": {"field_name": "country", "string_filter": {"value": "US"}}} {"and_group": {"expressions": [...]}} {"or_group": {"expressions": [...]}} {"not_expression": {...}} order_bys: list of {metric: {metric_name}, desc} or {dimension: {...}}. metric_aggregations: list of TOTAL|MINIMUM|MAXIMUM|COUNT. limit: max rows (hard cap 250000 per response). offset: pagination offset. keep_empty_rows: include rows where all metrics are zero. currency_code: override property default for revenue metrics. cohort_spec / comparisons: advanced specs (see REST docs).
Gotchas surfaced in response.metadata:
samplingMetadatas: present if query was sampled (> 10M events scanned)
dataLossFromOtherRow: true if high-cardinality dims collapsed into "(other)"
schemaRestrictionResponse: active thresholding rules
subjectToThresholding: true if user-privacy thresholding dropped rows
propertyQuota always included so the agent can self-throttle.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| metrics | No | ||
| order_bys | No | ||
| dimensions | No | ||
| cohort_spec | No | ||
| comparisons | No | ||
| date_ranges | No | ||
| property_id | Yes | ||
| currency_code | No | ||
| metric_filter | No | ||
| keep_empty_rows | No | ||
| dimension_filter | No | ||
| metric_aggregations | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |