How to query Google Analytics 4 from an AI assistant
Reports, realtime, funnels and the property configuration behind the numbers.
Both readings are on this page.
For you
What the answer looks like, and what to type to get it.
The way this normally goesLink to this section
- 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 assistantLink to this section
- 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 fromLink to this section
Traffic and conversionLink to this section
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 upLink to this section
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 usesLink to this section
| 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 doLink to this section
- 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: /guides/ga4-analysis.md
This job reads one source, across 5 tool calls. It changes nothing, so it works on every plan.
SequenceLink to this section
| 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 youLink to this section
- 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 askLink to this section
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?