★ Community Edition ★Price: Free



The Query Cookbook

GAQL query overview and the interactive query builder

Google's own reference for the Google Ads Query Language, paired with an interactive builder for constructing and validating queries against the current API version.

Every GAQL query, whether it runs in a Google Ads Script, the API directly, or a third-party reporting tool, is built on the same grammar: SELECT, FROM, WHERE, ORDER BY, LIMIT, over a fixed set of resources and fields. Google's own documentation is the primary reference for that grammar, and it is paired with an interactive query builder that lets you construct a query field by field and see it validated against the live schema before you paste it anywhere.

Why it made the cut

Every other GAQL query you will ever copy from a blog post, a script or a forum answer ultimately has to be checked against this reference, because field names and resource availability change between API versions and a query that worked last year can silently stop compiling. Going straight to the source instead of a secondhand snippet is the difference between debugging a query and guessing at it. The query builder in particular is worth bookmarking: it catches invalid field and resource combinations before you burn a script run finding out the hard way.

How to run it

  1. Read the overview page for the query structure: resources, attributes, metrics and segments, and how WHERE and ORDER BY behave.
  2. Open the interactive query builder and pick a resource (campaign, ad_group, keyword_view, and so on) to see its available fields.
  3. Build the query visually, or paste one in to validate it, then copy the checked GAQL into your script or API call.
  4. Cross-check any date-range or segment logic against the same reference before relying on it in a report.

Worth knowing

The documentation tracks the current stable API version by default; if you are maintaining an older integration pinned to a previous version, check the version selector before assuming a field is available or deprecated. It is a reference, not a script, so nothing here runs against your account on its own, you still paste the resulting query into a script, the API, or Google Ads Scripts' search()/search_stream() methods.

  • GAQL
  • Documentation