Skip to content
Get MCP AdsGet MCP Ads, home
Start free

How to query Google Analytics 4 from an AI assistant

Reports, realtime, funnels and the property configuration behind the numbers.

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

text
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

text
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

ToolWhy
ga4_get_metadataWhat this property actually has, rather than what GA4 has in general.
ga4_check_compatibilityAsk GA4 whether the selection is legal, before spending a call on it.
ga4_run_reportThe report itself.
ga4_run_funnel_recipeA funnel without composing the request by hand.
ga4_get_channel_groupsCustom 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

StepToolPurpose
1ga4_get_metadataWhat this property actually has, rather than what GA4 has in general.
2ga4_check_compatibilityAsk GA4 whether the selection is legal, before spending a call on it.
3ga4_run_reportThe report itself.
4ga4_run_funnel_recipeA funnel without composing the request by hand.
5ga4_get_channel_groupsCustom 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_accounts first 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

text
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?