maton google-ads query
maton google-ads query [flags]
POSTs a GAQL query to googleAds:search. Either provide –gaql with a complete query string, or pass –resource (with optional –fields, –where, –order-by, –limit) to compose one. When –fields is omitted the default is “
–paginate follows nextPageToken to concatenate all pages. For very large result sets prefer “query-stream”.
Options
-
--connection <string> - Connection ID to route through (Maton-Connection header)
-c,--customer-id <string>- Google Ads customer ID (required)
-
--dry-run - Print the request that would be sent without executing it
-
--fields <string> - Comma-separated fields to select
-
--format <string> - Output format: 'json' (default) or 'text' on supported commands
-
--gaql <string> - Raw GAQL query string
-q,--jq <expression>- Filter JSON output using a jq expression
-L,--limit <int> (default 0)- LIMIT number of results (0 = no limit)
-
--order-by <string> - ORDER BY field
-
--paginate - Follow next_cursor and concatenate all pages (list commands only)
-
--resource <string> - GAQL resource (e.g. campaign, ad_group, keyword_view)
-
--template <string> - Format JSON output using a Go template; see "maton help formatting"
-
--where <string> - WHERE clause (e.g. "campaign.status != 'REMOVED'")
Options inherited from parent commands
-
--login-customer-id <string> - Manager account ID for MCC access (forwarded as login-customer-id header)
-p,--profile <string>- Profile to use for this invocation (overrides the active profile; also reads MATON_PROFILE)
Examples
$ maton google-ads query -c 1234567890 --gaql 'SELECT campaign.id FROM campaign'
$ maton google-ads query -c 1234567890 --resource campaign --fields 'campaign.id, campaign.name' -L 10
$ maton google-ads query -c 1234567890 --resource campaign --paginate