GAQL cookbook
GAQL, the Google Ads Query Language, is how you ask the Google Ads API precise questions. These are the queries practitioners reach for most, each with the plain-language question it answers. They run anywhere GAQL runs: the API, scripts, or an AI assistant connected through a Google Ads MCP server.
If you connect your account to Claude with Adplane, you do not need to write any of these. Ask the question in the plain-language form and Claude writes and runs the GAQL for you, with money already converted out of micros into your account currency.
How did my campaigns do in the last 30 days?
How did my campaigns do last month?
SELECT
campaign.name,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
metrics.conversions,
metrics.conversions_value
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
ORDER BY metrics.cost_micros DESCThe bread-and-butter query. Money fields come back in micros: divide cost_micros by 1,000,000 for the amount in your account currency.
Which search terms spent money and never converted?
Show me search terms that cost more than 50 dollars and never converted.
SELECT
search_term_view.search_term,
campaign.name,
metrics.clicks,
metrics.cost_micros,
metrics.conversions
FROM search_term_view
WHERE segments.date DURING LAST_30_DAYS
AND metrics.conversions = 0
AND metrics.cost_micros > 50000000
ORDER BY metrics.cost_micros DESC50000000 micros is 50 units of your account currency. The classic negative-keyword mining query: what comes back is a candidate list for negatives.
Which ad groups have the highest cost per conversion?
Which ad groups have the highest cost per conversion in the last 30 days?
SELECT
campaign.name,
ad_group.name,
metrics.cost_micros,
metrics.conversions,
metrics.cost_per_conversion
FROM ad_group
WHERE segments.date DURING LAST_30_DAYS
AND metrics.conversions > 0
ORDER BY metrics.cost_per_conversion DESCWhich campaigns are losing impressions to budget?
Which of my campaigns are limited by budget?
SELECT
campaign.name,
metrics.search_budget_lost_impression_share,
metrics.search_impression_share,
metrics.cost_micros
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
AND metrics.search_budget_lost_impression_share > 0.1
ORDER BY metrics.search_budget_lost_impression_share DESCsearch_budget_lost_impression_share is the share of eligible impressions lost because budget ran out. Anything above 0.1 (ten percent) is worth a look.
Which keywords have a low quality score?
List my keywords with quality score 5 or below, highest spend first.
SELECT
campaign.name,
ad_group.name,
ad_group_criterion.keyword.text,
ad_group_criterion.quality_info.quality_score,
metrics.cost_micros
FROM keyword_view
WHERE segments.date DURING LAST_30_DAYS
AND ad_group_criterion.quality_info.quality_score <= 5
ORDER BY metrics.cost_micros DESCHow does performance split across devices?
Compare my campaign performance on mobile versus desktop.
SELECT
campaign.name,
segments.device,
metrics.clicks,
metrics.cost_micros,
metrics.conversions
FROM campaign
WHERE segments.date DURING LAST_30_DAYSAdding segments.device splits every row by device. The same pattern works for segments.day_of_week, segments.hour, and segments.date.
Which days of the week convert best?
Which days of the week get me the cheapest conversions?
SELECT
segments.day_of_week,
metrics.clicks,
metrics.cost_micros,
metrics.conversions
FROM campaign
WHERE segments.date DURING LAST_30_DAYSDo I have disapproved ads anywhere?
Do I have any disapproved ads?
SELECT
campaign.name,
ad_group.name,
ad_group_ad.ad.id,
ad_group_ad.policy_summary.approval_status
FROM ad_group_ad
WHERE ad_group_ad.policy_summary.approval_status = DISAPPROVEDNo date range needed: approval status is a property of the ad, not a metric.
Notes that save time
- Money is in micros. Divide cost_micros by 1,000,000. A cost_micros filter of 50000000 means 50 in your account currency.
- Date ranges are literal. DURING LAST_30_DAYS, LAST_7_DAYS, THIS_MONTH, or an explicit BETWEEN '2026-07-01' AND '2026-07-31'.
- Segments multiply rows. Every segment you SELECT splits the results by that dimension, so add only the segments you want to group by.
- GAQL reads, it does not write. Queries are SELECT statements; changing anything goes through mutate operations, a separate API surface entirely.
Run these without writing them
Adplane connects your Google Ads accounts to Claude. Ask any question on this page in plain language and Claude answers from your live data, or hand it raw GAQL and it runs the query as written. The free trial is 14 days and does not require a card. Connect your account or read the docs first.