How to query Google Analytics 4 from an AI assistant
Reports, realtime, funnels and the property configuration behind the numbers.
guides/ga4-analysis.mdFor you
What the answer looks like, and what to type to get it.
The way this normally goes
- Build an exploration, pick dimensions, wait, adjust, wait again.
- Discover the dimension you wanted is not compatible with the metric you wanted.
The way it goes with an assistant
- Ask the question.
- The gateway validates the combination against GA4's own compatibility rules before it calls.
- An incompatible pair is refused with the reason, not with an empty table.
Prompts to start from
Traffic and conversion
Sessions, engaged sessions and conversions by channel group for the last 28 days.
Did the checkout funnel move after Tuesday's release?
Which landing pages lost engagement this month?
What is happening on the site right now?How the property is set up
What custom channel groups exist on this property?
Which events are marked as key events?
What custom dimensions and metrics are defined?
Is the ecommerce setup reporting cleanly?Tools this uses
| Tool | Why |
|---|---|
ga4_get_metadata | What this property actually has, rather than what GA4 has in general. |
ga4_ | Ask GA4 whether the selection is legal, before spending a call on it. |
ga4_run_report | The report itself. |
ga4_ | A funnel without composing the request by hand. |
ga4_ | Custom channel groups, which the reporting API alone does not expose. |
What it will not do
- GA4 is read only here. Nothing in the property can be changed.
- Sampling and thresholding are GA4's, and are reported rather than hidden.
For your agent
The tool sequence, the parameters that matter, and what will be refused.
Both readings as Markdown: /
This job reads one source, across 5 tool calls. It changes nothing, so it works on every plan.
Sequence
| Step | Tool | Purpose |
|---|---|---|
| 1 | ga4_get_metadata | What this property actually has, rather than what GA4 has in general. |
| 2 | ga4_ | Ask GA4 whether the selection is legal, before spending a call on it. |
| 3 | ga4_run_report | The report itself. |
| 4 | ga4_ | A funnel without composing the request by hand. |
| 5 | ga4_ | Custom channel groups, which the reporting API alone does not expose. |
Constraints that will refuse you
- Only the ad accounts the account owner ticked are reachable. Call
list_accountsfirst rather than guessing an identifier. - GA4 is read only here. Nothing in the property can be changed.
- Sampling and thresholding are GA4's, and are reported rather than hidden.
What the person is likely to ask
Sessions, engaged sessions and conversions by channel group for the last 28 days.
Did the checkout funnel move after Tuesday's release?
Which landing pages lost engagement this month?
What is happening on the site right now?
What custom channel groups exist on this property?
Which events are marked as key events?
What custom dimensions and metrics are defined?
Is the ecommerce setup reporting cleanly?Manage your ads from your AI assistant
Start for free
Free with 1 ad account, no card. Pro is free for 7 days.