# Validate a GA4 query before running it

> Tier: recipe. Operating recipe: real tool sequence, core rules, known traps.

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

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

## When to use

- Any bespoke or batched report.

## When not to use

- No specific contraindication beyond the preconditions below.

## Sources

Required: Google Analytics 4

## Preconditions

- The account is ticked in the dashboard, confirmed via list_accounts.

## Inputs

- `window`: Analysis window. Default: last 30 days.

## Procedure

1. Validate the query. — tools: `ga4_validate_query`
2. Run only after it passes. — tools: `ga4_run_report`

## Decision rules

- **When** Validation flags a field → **conclude** Fix the design: retrying the same shape burns quota on a known failure.

## Evidence requirements

- Every figure carries its account, metric and window.
- Anything below a readable sample size is reported as unjudged, not as zero.

## Human approval boundary

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

## Failure modes

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

## Output

- **Readout**: The figures, with windows and accounts named.
- **Flags**: What deserves a deeper skill or a human decision.
