A Google Ads API mock for updating campaigns.
Your agent reads seeded campaigns with GAQL and updates a campaign. Check the campaign mutation and read back its status and budget.
campaign_updatedCalls POST /v26/customers/*/campaigns:mutate
Starting records
customers
- id
1000000000- descriptiveName
Acme manager
customers
- id
1000000001- descriptiveName
Acme US
Connect your agent to the Google Ads mock
When ancha runs your agent, it sets:
GOOGLE_ADS_API_URLGOOGLE_ADS_ACCESS_TOKENGOOGLE_ADS_GRPC_ENDPOINTGOOGLE_ADS_TLS_ROOT_CERT_BASE64
Point the client you already use at them.
const response = await fetch(process.env.GOOGLE_ADS_API_URL + '/v26/customers/1000000001/googleAds:search', {method:'POST',headers:{Authorization:'Bearer '+process.env.GOOGLE_ADS_ACCESS_TOKEN,'login-customer-id':'1000000000','Content-Type':'application/json'},body:JSON.stringify({query:'SELECT campaign.id, campaign.name, campaign.status FROM campaign'})});
const campaigns = await response.json();Locally, ancha runs your agent as an ordinary process, so keep real Google Ads credentials out of its environment.
See all 9 endpoints
adGroupAds
/v26/customers/:customerId/adGroupAds:mutateadGroupCriteria
/v26/customers/:customerId/adGroupCriteria:mutateadGroups
/v26/customers/:customerId/adGroups:mutatecampaignBudgets
/v26/customers/:customerId/campaignBudgets:mutatecampaigns
/v26/customers/:customerId/campaigns:mutatecustomers
/v26/customers:listAccessibleCustomersgoogleAds
/v26/customers/:customerId/googleAds:mutate/v26/customers/:customerId/googleAds:search/v26/customers/:customerId/googleAds:searchStreamSeed your own data
The data the Google Ads mock starts with on every run, cut to a few records. ancha twins seed google-ads prints every field.
Full seed YAML
twins:
- google-ads
seed:
google-ads:
customers:
- id: "1000000000"
descriptiveName: Acme manager
currencyCode: USD
timeZone: America/Los_Angeles
manager: true
- id: "1000000001"
descriptiveName: Acme US
currencyCode: USD
timeZone: America/Los_Angeles
manager: false
parentId: "1000000000"
budgets:
- name: Enterprise search daily budget
amountMicros: "150000000"
id: "2001"
resourceName: customers/1000000001/campaignBudgets/2001
campaigns:
- name: Ridgeway Robotics · enterprise intent
advertisingChannelType: SEARCH
campaignBudget: customers/1000000001/campaignBudgets/2001
manualCpc: {}
containsEuPoliticalAdvertising: DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
id: "3001"
resourceName: customers/1000000001/campaigns/3001
adGroups:
- name: Robotics operations buyers
campaign: customers/1000000001/campaigns/3001
cpcBidMicros: "6500000"
id: "4001"
resourceName: customers/1000000001/adGroups/4001
ads:
- adGroup: customers/1000000001/adGroups/4001
ad:
finalUrls:
- https://acme.example/ridgeway
responsiveSearchAd:
headlines:
- text: Operations That Scale
- text: A Clearer Sales Pipeline
- text: Built For Robotics Teams
descriptions:
- text: Connect buyer intent with a shared sales plan for your next stage of growth.
- text: See how Acme helps operations teams turn account insight into action.
id: "5001"
resourceName: customers/1000000001/ads/5001
type: RESPONSIVE_SEARCH_AD
resourceName: customers/1000000001/adGroupAds/4001~5001
policySummary:
reviewStatus: REVIEWED
approvalStatus: APPROVED
criteria:
- adGroup: customers/1000000001/adGroups/4001
keyword:
text: robotics operations software
matchType: PHRASE
resourceName: customers/1000000001/adGroupCriteria/4001~6001
criterionId: "6001"
type: KEYWORD
reports:
- campaign: customers/1000000001/campaigns/3001
date: 2026-10-24
impressions: "8200"
clicks: "104"
costMicros: "126700000"
conversions: 4
access:
directCustomerIds:
- "1000000000"
provenance:
dataset: b2b-google-ads-starter-v1
companyKey: acme
synthetic: true
Check what your agent did
Checks YAML
checks:
- id: campaign_updated
trace:
called: POST /v26/customers/*/campaigns:mutateMore marketing tools
All 43 toolsGoogle Ads API mock FAQ
How does the Google Ads mock calculate campaign metrics for a GAQL query?
Ancha reads seeded campaign report rows and filters them by segments.date. Selecting segments.date returns daily metrics; without it, the mock totals impressions, clicks, costMicros and conversions over the matching reports. Relative ranges such as LAST_7_DAYS use the simulation clock and the customer's timezone.
Can I validate Google Ads campaign changes before saving them in a test?
Set validateOnly: true on a resource-specific mutation request, such as MutateCampaigns. Ancha validates the operations and rolls back their changes before returning the validation result.
What happens if one Google Ads operation in a batch is invalid?
With partialFailure: true, the mock keeps successful resource-specific operations and reports validation failures in partialFailureError, with an empty result at each failed operation's position. With partialFailure false, a validation error rolls back the batch.
Install the CLI and run your agent against the Google Ads mock.
Ancha is not affiliated with Google Ads.