Media buyers keep asking the same question: can I just tell Claude to pause my worst ad groups instead of clicking through the Google Ads UI? The answer is yes — through Claude Code, Anthropic's CLI coding agent, driving the Google Ads API. This guide walks the setup end to end, then the honest trade-offs.
What "Claude Code for Google Ads" actually means
Claude Code isn't a Google Ads integration — it's a coding agent. It can't click around your account. What it can do is write and run code against the official Google Ads API on your behalf. You describe a task in plain English; it generates the script, runs it, and reports the result.
So "using Claude Code for Google Ads" really means: give Claude Code access to the Google Ads API, then operate your account through the code it writes.
Step 1 — Get Google Ads API access
This is the part that has nothing to do with AI, and it's the part most people get stuck on.
- Developer token. In a Google Ads Manager (MCC) account, open Tools → API Center and apply for a developer token. (Test-account access is instant; production access needs a short approval.)
- OAuth2 client. In a Google Cloud project, enable the Google Ads API, then create an OAuth client ID + secret.
- Refresh token. Run Google's OAuth flow once (their
generate_user_credentials script or the OAuth Playground) to get a long-lived refresh token for your account.
Keep the developer token, client ID, client secret, refresh token, and your customer IDs handy — that's everything the API needs. (The MCC account ID is your login_customer_id; the account you're actually managing is the operating customer ID.)
Step 2 — Install Claude Code
Install Claude Code and open it in a fresh project folder (e.g. google-ads-bot/). This folder is where it'll keep the script and config it writes.
Step 3 — Let Claude Code scaffold the integration
Now hand it the work. A first prompt like:
"Set up the official google-ads Python library in this project. Create a google-ads.yaml with placeholders for my developer token, client ID, client secret, refresh token, and login customer ID. Then write a script that authenticates and lists my campaigns to confirm it works."
Claude Code will pip install google-ads, write the google-ads.yaml, scaffold the auth, and run the test query. Fill in your real credentials, run it once, and you've confirmed the connection.
Step 4 — Run real tasks in plain English
From here you just describe what you want. Claude Code writes the GAQL query or mutation and runs it:
- "Audit search terms from the last 30 days and list the ones with spend over $50 and zero conversions."
- "Pull a 7-day performance report by campaign — spend, conversions, CPA, ROAS — as a CSV."
- "Pause every ad group with CPA above $80 over the last 14 days." (Have it show you the list first.)
- "Add this list of negative keywords to the Brand campaign."
For reads, let it run freely. For writes, have it print the planned change and run it only after you've read it.
The honest trade-offs
This is genuinely powerful — it's the full Google Ads API, driven in natural language, for free beyond your Claude subscription. But know what you're signing up for:
- You maintain it. OAuth refresh tokens expire, the Google Ads API versions bump (and deprecates old ones), rate limits and error handling are yours to manage. The script that worked last quarter may break this quarter.
- No approval gate or audit log. The script has full write access. A bug can make a change you didn't intend, and there's no record of who changed what unless you build one.
- It runs on your machine. No schedule, no team access, no Slack delivery — it runs when you run it.
- It's a builder's tool. You need to get through the API setup, read the generated code before running writes, and debug when something breaks.
If you like owning the code, that's a fair trade. If you want the same capability to just run, read on.
The managed alternative: skip the scripts
The reason most teams eventually move off the DIY route is maintenance — the scripts are great until they break on a Tuesday before a campaign launch.
Junior is an AI employee with native Google Ads support — the same "describe it in plain English" power, but managed:
- No scripts to maintain — no OAuth refresh, no API-version bumps, no
google-ads.yaml.
- Approval-gated — every change is proposed in Slack with the reasoning; you approve before it touches the account.
- Runs on a schedule, from Slack — the daily audit and weekly report show up without you running anything.
- Audit log + guardrails — every action is recorded; you can require multi-person approval on big budget changes.
It's the difference between a tool you operate and a teammate who operates the tools. See Google Ads automation with Junior, or the same approach for Meta Ads.
Bottom line
Claude Code + the Google Ads API is a real, powerful DIY setup: four setup steps, then natural-language control of your account. The catch is everything around the edges — auth, maintenance, no approval gate, no schedule. If you enjoy owning that, this guide gets you there. If you'd rather it just ran — safely, on a schedule, from Slack — that's what a managed AI employee is for.
FAQ
- Can Claude Code actually control Google Ads?
- Not directly — Claude Code is a coding agent, not a Google Ads integration. But it can write and run code against the official Google Ads API on your behalf. Once you've given it API access, you describe a task in plain English ('pause ad groups with CPA over $80 in the last 14 days') and it writes the script, runs it, and reports back. So in practice, yes — it operates your account through code it generates.
- What do I need to use Claude Code with Google Ads?
- Four things: (1) a Google Ads developer token from your Manager (MCC) account's API Center, (2) an OAuth2 client (client ID + secret) from a Google Cloud project with the Google Ads API enabled, (3) a refresh token generated for that client, and (4) Claude Code installed locally. With those, Claude Code can install the google-ads Python library, write a google-ads.yaml config, and start making calls.
- Is it safe to let Claude Code change my live Google Ads account?
- It can be, but you own the guardrails. The script runs with full write access to your account and there's no built-in approval step — if the generated code has a bug, it can make a change you didn't intend. Best practice: have it run read-only audits first, review every write before running it, and test against a low-spend account. There's no audit log or multi-person approval unless you build one.
- What's the difference between using Claude Code and a tool like Junior for Google Ads?
- Claude Code is DIY: you set up API access, it writes scripts, and you maintain them (auth refresh, API version bumps, error handling) on your own machine. Junior is managed: it has native Google Ads support, runs from Slack with an approval gate before any change, keeps an audit log, and there are no scripts to maintain. Use Claude Code if you enjoy owning the code; use a managed AI employee if you want it to just run.
- Do I need to know how to code?
- Less than you'd think — Claude Code writes the code. But you do need to get through the Google Ads API setup (tokens and OAuth), read what the generated script does before running it, and debug when something breaks. If that sounds like more than you want to own, a managed option skips all of it.