Guides
GAQL
The subset of the Google Ads Query Language that Mimicr runs in googleAds:search and searchStream, with resources, operators, dates and pagination.
Reads in the Google Ads API are GAQL queries sent to googleAds:search (paginated) or googleAds:searchStream (in batches). The grammar is the official one; Mimicr runs the subset described here.
A query
curl --request POST \
--url https://google-ads.mimicr.dev/v26/customers/2220330728/googleAds:search \
--header 'Authorization: Bearer <token>' \
--header 'login-customer-id: 6446154552' \
--header 'Content-Type: application/json' \
--data '{ "query": "SELECT ad_group_ad.ad.id, segments.date, metrics.cost_micros, metrics.impressions, metrics.clicks FROM ad_group_ad WHERE campaign.id = 54542599977 AND segments.date BETWEEN '\''2026-11-01'\'' AND '\''2026-11-06'\''" }'{
"results": [
{
"adGroupAd": { "resourceName": "customers/2220330728/adGroupAds/54542599986~54542599990", "ad": { "resourceName": "customers/2220330728/ads/54542599990", "id": "54542599990" } },
"metrics": { "clicks": "31", "costMicros": "38440000", "impressions": "702" },
"segments": { "date": "2026-11-05" }
}
],
"fieldMask": "adGroupAd.ad.id,segments.date,metrics.costMicros,metrics.impressions,metrics.clicks",
"queryResourceConsumption": "6"
}- Each resource includes only the selected fields, plus
resourceName. - int64 values (ids, micros, impressions, clicks) come as strings;
ctr,averageCpcandconversionsas numbers. A selected metric that is zero comes as"0". resultsis omitted when empty.
Grammar
SELECT field [, field...] FROM resource [WHERE condition [AND condition...]] [ORDER BY field [ASC|DESC] [, ...]] [LIMIT n] [PARAMETERS include_drafts=true|false]
| Operator | Example |
|---|---|
=, !=, >, >=, <, <= | campaign.id = 54542599977 |
IN, NOT IN | campaign_criterion.type IN ('PROXIMITY', 'LOCATION') |
LIKE, NOT LIKE | campaign.name LIKE 'Gás%' (% any sequence, _ one character) |
CONTAINS ANY, CONTAINS ALL, CONTAINS NONE | campaign.primary_status_reasons CONTAINS ANY ('NO_KEYWORDS') |
BETWEEN | segments.date BETWEEN '2026-11-01' AND '2026-11-06' |
DURING | segments.date DURING LAST_7_DAYS |
IS NULL, IS NOT NULL | campaign.end_date_time IS NULL |
- Enums can be quoted or unquoted:
campaign.status = 'ENABLED'or= ENABLED. - GAQL has no
OR:queryError: UNEXPECTED_INPUT. REGEXP_MATCHis not simulated:queryError: BAD_OPERATOR"Not simulated by Mimicr: REGEXP_MATCH".- An
INaccepts up to 20,000 values.LIMIT 0givesLIMIT_VALUE_TOO_LOW.
FROM resources
| FROM | Can also select | Metrics | Segments |
|---|---|---|---|
customer | — | yes (not in an MCC) | date, day_of_week, hour, device, ad_network_type |
customer_client | customer | no | no |
campaign_budget | customer | yes | dates |
campaign | campaign_budget, customer | yes | all, including conversion_action |
campaign_criterion | campaign, customer | no | no |
ad_group | campaign, campaign_budget, customer | yes | same as campaign |
ad_group_ad | ad_group, campaign, campaign_budget, customer | yes | same as campaign |
ad_group_criterion | ad_group, campaign, customer | no | no |
keyword_view | ad_group, campaign, customer | yes | same as campaign |
conversion_action | customer | no | no |
asset, campaign_asset | campaign (in campaign_asset), customer | no | no |
lead_form_submission_data | customer | no | no |
geo_target_constant, language_constant | — | no | no |
Every field of the covered resources can be read, in snake_case (ad_group_ad.policy_summary.approval_status). Google resources outside the table (search_term_view, geographic_view, click_view…) give PROHIBITED_RESOURCE_TYPE_IN_FROM_CLAUSE "(not simulated by Mimicr)". An unknown field gives UNRECOGNIZED_FIELD.
Metrics and segments
Metrics: impressions, clicks, interactions, cost_micros, ctr, average_cpc, average_cost, average_cpm, conversions, conversions_value, all_conversions, all_conversions_value, cost_per_conversion, value_per_conversion and conversions_from_interactions_rate. Others give UNRECOGNIZED_FIELD "(not simulated by Mimicr)".
Segments: date, week, month, quarter, year, day_of_week, hour, device (MOBILE, DESKTOP, TABLET), ad_network_type (SEARCH, SEARCH_PARTNERS), conversion_action and conversion_action_name.
- With segments, rows where every metric is zero are not returned. Without segments, the resource row is returned even when zero (lifetime totals).
- Metrics on a manager account (MCC) give
queryError: REQUESTED_METRICS_FOR_MANAGER.
Dates
- Dates are evaluated in the account's time zone, on the sandbox clock.
- Selecting
segments.date,week,month,quarteroryearrequires a finite date filter in the WHERE clause, otherwiseEXPECTED_FILTERS_ON_DATE_RANGE. DURINGacceptsTODAY,YESTERDAY,LAST_7_DAYS,LAST_14_DAYS,LAST_30_DAYS,LAST_BUSINESS_WEEK,THIS_MONTH,LAST_MONTH,THIS_WEEK_SUN_TODAY,THIS_WEEK_MON_TODAY,LAST_WEEK_SUN_SATandLAST_WEEK_MON_SUN.LAST_N_DAYSdoes not include today.- Literal dates:
'2026-11-05'or'20261105'.segments.weekmust be a Monday andsegments.monththe 1st of the month (MISALIGNED_DATE_FOR_FILTER).
Pagination and options
- Pages have a fixed 10,000 rows. Sending
pageSizegivesrequestError: PAGE_SIZE_NOT_SUPPORTED. nextPageTokenappears while there are more pages; send it inpageTokenwith the same query. A different query givesINVALID_PAGE_TOKEN; in Mimicr, a token older than 2 hours givesEXPIRED_PAGE_TOKEN.searchSettings.returnTotalResultsCountreturnstotalResultsCount;returnSummaryRowreturnssummaryRowwith the metric totals.validateOnly: trueonly validates the query and responds{}.
searchStream
The response is a JSON array of batches of up to 10,000 rows (not NDJSON). With summaryRowSetting: SUMMARY_ROW_WITH_RESULTS, the last batch carries summaryRow:
[
{ "results": [{ "campaign": { "resourceName": "customers/2220330728/campaigns/54542599977", "id": "54542599977", "name": "Campanha Goiânia" }, "metrics": { "impressions": "702", "clicks": "31", "costMicros": "38440000" } }], "fieldMask": "campaign.id,campaign.name,metrics.impressions,metrics.clicks,metrics.costMicros", "requestId": "5DIgwf8lH1GQfd6kw_7Yj9" },
{ "summaryRow": { "metrics": { "impressions": "702", "clicks": "31", "costMicros": "38440000" } }, "fieldMask": "campaign.id,campaign.name,metrics.impressions,metrics.clicks,metrics.costMicros", "requestId": "5DIgwf8lH1GQfd6kw_7Yj9" }
]Removed items
Removed campaigns, ad groups and ads still show up in queries, with their metrics, and can be filtered with status = 'REMOVED'. In Mimicr, removed criteria (campaign_criterion, ad_group_criterion) are only returned when the query filters on their status.