Skip to content
Get MCP Ads, home

Validate a GA4 query before running it

Query validation as a habit on bespoke reports, especially batched ones.

Recipe, Google Analytics 4

Intent Catch the shape errors before they cost a quota token.

Steps
2
Tools
2
Rules
1
Failure modes
1
skills/ga4-validate-before-run.md

When to use it

Use it when

  • Any bespoke or batched report.

Do not use it when

  • No specific contraindication beyond the preconditions below.

What it needs first

Preconditions

  • The account is among the chosen accounts, confirmed via list_accounts.

Evidence every conclusion must carry

  • Every figure carries its account, metric and window.
  • Anything below a readable sample size is reported as unjudged, not as zero.
Inputs
InputRequiredWhat it is
windowAnalysis window.Default: last 30 days.

Procedure

In order. Every tool named is one the gateway ships, and links to its reference.

Steps

  1. Validate the query.ga4_validate_query
  2. Run only after it passes.ga4_run_report

Decision rules

The observable condition, what it lets you conclude, and what takes the conclusion back.

  • When Validation flags a fieldConclude Fix the design: retrying the same shape burns quota on a known failure.

Where the agent stops

The readout changes nothing. Any change it motivates goes through Safe Writes: preview, human confirmation, then apply.

How it goes wrong quietly

The cases where the analysis is wrong and still looks right. Read them before trusting a number.

  • Validation checks shape, not sense: a valid query can still answer the wrong question.

What the answer contains

What Query validation returns
SectionWhat it holds
ReadoutThe figures, with windows and accounts named.
FlagsWhat deserves a deeper skill or a human decision.

Manage your ads from your AI assistant

Start for free

Free with 1 ad account, no card. Pro is free for 7 days.