Google Analytics 4 / API Reference
ga4_top_n
GA4 analytics tool. Get the top N rows for any dimension ranked by a metric. Args: dimension: GA4 dimension to group by (e.g. 'pagePath', 'country', 'sessionCampaignName'). metric: Metric to rank by (default 'sessions'). n: Number of rows to return (default 10). property_id: GA4 property ID. Leave blank to use default. days: Number of days to look back (default 30).
This is a read-only tool: it returns top n for 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:
Top n in my Google Analytics 4 account for [dimension].
It takes 1 required and 4 optional parameters.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dimension | string | Yes | Dimension |
metric | string | No | Metric |
n | integer | No | N |
property_id | string | No | Property Id |
days | integer | No | Days |
Related Google Analytics 4 tools
ga4_top_pagesga4_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: