Google Analytics 4 / API Reference
ga4_compare_two_dates
GA4 analytics tool. Compare two custom date ranges side by side for any dimensions and metrics. Args: property_id: GA4 property ID. Leave blank to use default. dimensions: List of GA4 dimension names (e.g. ['sessionDefaultChannelGroup']). metrics: List of GA4 metric names (e.g. ['sessions', 'conversions']). period1_start: Period 1 start date YYYY-MM-DD. period1_end: Period 1 end date YYYY-MM-DD. period2_start: Period 2 start date YYYY-MM-DD. period2_end: Period 2 end date YYYY-MM-DD. sort_metric: Metric to sort by (descending). row_limit: Max rows (default 20).
This is a read-only tool: it compares two dates from your Google Analytics 4 account. It changes nothing.
Ask Claude
You do not call this tool yourself. Ask for the outcome and the client picks the tool:
Compare two dates in my Google Analytics 4 account.
It takes 0 required and 9 optional parameters.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
property_id | string | No | Property Id |
dimensions | array | No | Dimensions |
metrics | array | No | Metrics |
period1_start | string | No | Period1 Start |
period1_end | string | No | Period1 End |
period2_start | string | No | Period2 Start |
period2_end | string | No | Period2 End |
sort_metric | string | No | Sort Metric |
row_limit | integer | No | Row Limit |
Related Google Analytics 4 tools
ga4_compare_date_rangesga4_acquisition_channelsga4_attribution_pathsga4_audiencesga4_audit_property_settingsga4_available_metrics
Before you can call it
This tool needs a connected Google Analytics 4 account. The Google Analytics 4 connect guide covers the OAuth flow and the permissions it asks for, and the quickstart gets a client talking to the server in about five minutes.
Workflows that use this
Rather than calling tools one at a time, these skills run a whole procedure against the same account: