Claude Code — Google Ads API Diagnosis & Automation
Overview
Claude Code can connect directly to the Google Ads API via MCP (Model Context Protocol) servers to diagnose account problems, execute fixes, and generate change reports — all from a terminal session without logging into the Google Ads console. A live demo during the [1] weekly review on 2026-03-04 showed the tool diagnosing a zero-conversion account, identifying root causes, and executing bulk fixes in a single session.
This capability is relevant to any client account and can be scheduled as a recurring automated job.
How It Works
Architecture
- Claude Code runs in a terminal and accepts natural-language instructions
- MCP servers act as bridges between Claude and external tools (Google Ads API, Google Sheets, HubSpot, etc.)
- A credentials database (Google Sheet) stores per-client API keys, account IDs, GTM containers, GA4 properties, and more — Claude looks up credentials automatically by client name
- Claude writes and executes Python scripts on the fly to query or mutate account data
Workflow Pattern
- Point Claude at a client account by name
- Ask for a general diagnosis or a specific task
- Claude pulls live data via the API, builds a structured analysis, and lists problems
- Instruct Claude to execute fixes (it calls the API directly — no manual console work)
- At session end, ask Claude to write a change report; post to Slack or Google Drive
Agent Swarms & Cron Jobs
Claude Code sessions can be scripted and scheduled as cron jobs, enabling fully automated weekly account audits. Multiple agents can run simultaneously ("agent swarm"), processing several accounts in parallel overnight.
What Claude Code Diagnosed (Quarrowstone Demo)
The Quarrowstone Google Ads account had zero conversions. Claude identified the following root causes within minutes of connecting:
| Problem | Detail |
|---|---|
| Conversion goal bloat | 16 conversion actions, many auto-created duplicates; bidding algorithm had nothing meaningful to optimize |
| Wrong bidding strategy | "Maximize Conversions" requires ~30 days of conversion history; account had none |
| Keyword bloat | 200 keywords across ad groups; only 10 generated any traffic |
| Irrelevant broad match traffic | Queries like "bronze statues," "marble floor cleaner," "granite countertop repair" were triggering ads |
| No negative keywords | Two largest campaigns had zero negatives; shared lists inherited from unrelated accounts |
| Low Quality Scores | Scores of 2–4 on key keywords; root cause is landing page relevance |
| Brand search waste | Brand terms spread across all campaigns; $0.30 CPC brand clicks displacing $5 CPC non-brand budget |
| Retargeting audience gap | Display retargeting campaign active but getting zero impressions — likely missing audience list |
| Low optimization score | Below 80; Google penalizes accounts under this threshold |
Fixes Executed in Session
All of the following were performed by Claude via API calls, not manual console edits:
Conversion Goals
- Reduced 16 conversion actions to 2 biddable goals: website contact form submission and Google-hosted lead form
- Remaining actions (page views, phone calls from website, email clicks) set to observation only
- Enables "Maximize Conversions" to function correctly once conversion history accumulates
Negative Keywords
- Added 839 negative keywords across all active campaigns, organized by category:
- ~68 broad match negatives per campaign (residential, wrong materials, cleaning, buy/shop/for sale)
- ~95 exact match competitor terms
- ~71 fine art–specific negatives (art foundry, metal sculpture, wood sculpture)
- ~180 restoration-specific negatives
- Brand terms added as negatives to non-brand campaigns (to be isolated in a dedicated brand campaign)
Keyword Cleanup
- Removed irrelevant keywords from ad groups (e.g., bronze statues, wax statue maker, life-size custom dog statue)
- Reduced keyword count from 127 to 104; remaining keywords assessed as mostly on-topic
- Broad match expansions identified as the primary source of garbage traffic (not the keyword list itself)
Bidding Strategy (manual, pre-demo)
- All campaigns switched from "Maximize Conversions" → "Maximize Clicks" with $4 max CPC
- Budgets raised from $7/day → $16/day per search campaign to enable ~4 clicks/day
- Retargeting budget set to $10/day
Remaining Actions (Not Automated)
Some fixes require human or design input and cannot be executed via API:
- Landing pages — Quality Scores of 2–4 require improved landing page relevance; needs Carly's involvement
- Brand campaign — Claude identified the need; creation should be done deliberately with proper structure
- Retargeting audience list — Verify the pixel is populating an audience; add list to display campaign if missing
- Optimization score — Applied Google's RSA recommendations to raise score to 83; maintain ≥80 ongoing
Setup Recommendations
Based on the demo session, the following setup will make Claude Code more effective for Google Ads work:
- Create a dedicated Google Ads workspace — Isolate Google Ads MCP servers and context from the general multi-tool workspace to reduce latency and confusion
- Teach it account-specific context — Document bidding philosophy, client goals, and known issues in the project memory
- Schedule cron jobs for recurring tasks: weekly keyword cleanup, optimization score checks, negative keyword expansion
- End-of-session error review — Always ask Claude to review errors from the session and store fixes in memory to avoid repeating mistakes
- Change report to Slack/Drive — Instruct Claude to write a structured report of every change made; post to the client's Slack channel or Drive folder
Limitations Observed
- API caching — Changes made in the console may not immediately reflect when Claude queries the API; Claude will note this and verify
- Syntax errors on first run — Claude occasionally generates malformed API calls on novel tasks; it self-corrects, but the first pass may fail on a subset of operations
- Server degradation — Claude's API servers can experience downtime or slowdowns (observed during this demo); check downdetector.com if sessions are unusually slow
- Cannot fix landing pages — Quality Score improvements require design/dev work outside the API
Related
- [1] — client where this was first demonstrated
- [2] — bidding strategy sequencing (Maximize Clicks → Maximize Conversions)
- [3] — maintaining ≥80 threshold
- [4] — companion internal tool for cross-channel client intelligence