customers list is discovery: it lists directly accessible customer resource names.
customers hierarchy is a convenience GAQL wrapper over customer_client.
campaigns list, adgroups list, and ads list are convenience GAQL wrappers with curated default fields.
gaql search and gaql search-stream are the native Google escape hatches for anything more complex.
Keep Google commands provider-native. Do not remap them into insights query.
Pagination
Google uses page-token pagination:
Flag
Meaning
--page-token <token>
Resume from nextPageToken
--all
Follow all pages
--max-items <n>
Stop after N rows
Google search returns fixed-size API pages, so there is no page-size override.
gaql search-stream does not use page tokens; use --max-items if needed.
Common Mistakes
Forgetting one of the four required Google credential pieces
Expecting a cross-provider insights query surface; for Google, use gaql search
Omitting login_customer_id when querying through a manager account
Guide
Google Workflows
End-to-end recipes for Google Ads. Each workflow is a sequence of commands you can run in order.
First command
Google Workflows
bash
# Step 1: List all accessible customersagent-adsgooglecustomerslist--all--pretty# Step 2: Explore a customer hierarchy (manager accounts)agent-adsgooglecustomershierarchy--customer-id1234567890--all
1. Account Discovery
Start from your credentials and discover all accessible customers:
bash
# Step 1: List all accessible customersagent-adsgooglecustomerslist--all--pretty# Step 2: Explore a customer hierarchy (manager accounts)agent-adsgooglecustomershierarchy--customer-id1234567890--all
If you query through a manager account, set login_customer_id in config or pass GOOGLE_ADS_LOGIN_CUSTOMER_ID.
2. Campaign Overview
bash
# List campaignsagent-adsgooglecampaignslist--customer-id1234567890# List ad groupsagent-adsgoogleadgroupslist--customer-id1234567890# List adsagent-adsgoogleadslist--customer-id1234567890
3. GAQL Performance Report
Pull campaign metrics with a native GAQL query:
bash
agent-adsgooglegaqlsearch\--customer-id1234567890\--query"SELECT campaign.id, campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros FROM campaign WHERE segments.date DURING LAST_7_DAYS"
search-stream avoids page-token overhead for large result sets:
bash
agent-adsgooglegaqlsearch-stream\--customer-id1234567890\--query"SELECT ad_group.id, ad_group.name, metrics.impressions, metrics.clicks FROM ad_group WHERE segments.date DURING LAST_30_DAYS"\--formatcsv\--outputadgroup-report.csv
5. CI / Automation Pattern
bash
#!/bin/bashset-euopipefail# Verify setupagent-adsgoogledoctor--api-q# Pull yesterday's campaign dataagent-adsgooglegaqlsearch-stream\--customer-id1234567890\--query"SELECT campaign.id, campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros FROM campaign WHERE segments.date = '$(date -d yesterday +%Y-%m-%d)'"\--formatcsv\--output/data/google-yesterday.csvecho"Report saved to /data/google-yesterday.csv"
Exit codes make it safe in set -e scripts: 0 = success, 1 = transport/internal, 2 = config/argument, 5 = Google API error.
6. Piping and Composing
bash
# Pretty-print to lessagent-adsgooglecampaignslist--customer-id1234567890--pretty|less# Filter with jqagent-adsgooglecampaignslist--customer-id1234567890--all\|jq'.[] | select(.campaign.status == "ENABLED")'# Count enabled campaignsagent-adsgooglecampaignslist--customer-id1234567890--all\|jq'[.[] | select(.campaign.status == "ENABLED")] | length'