Build Your First Marketing AI Agent
A practical build guide for your first marketing AI agent — a Google Ads negative keyword agent that monitors your search term report, classifies wasted spend, and surfaces recommendations automatically on a schedule.
Create, optimize, and measure content that actually drives leads with Content Hub.
Cody Schneider, co-founder of Graph.com, built and deployed four marketing agents for Facebook Ads, Google Ads, SEO, and cold email — each running autonomously against live data. The framework behind all of it is simpler than it looks: agents work where there's a repeatable process, a live data stream, and a binary or scored decision. Use this to find where that's already true in your marketing and what to build next.
This guide walks you through building one real, functional agent — a Google Ads negative keyword agent — from scratch. It's the highest-leverage, most consistently neglected task in paid search. Most teams do it monthly at best. An agent can do it continuously.
Before you build
Cody's framework: use software for what software is good at, use AI only where you actually need language understanding.
Sorting data, filtering rows, checking whether a keyword already exists in your negative list — none of that needs an AI model. It's just logic. Deciding whether a search term reflects genuine commercial intent worth excluding — that's where the AI earns its keep.
What you need before you start
- Access to Google Ads
- An API key from OpenAI or Anthropic
- Claude Code or Codex as your coding agent
- A Google Sheet — this is your interface and output layer
Step 1: Set up your data source
Your agent needs raw material. In Google Ads, that's your Search Terms report — the actual queries that triggered your ads, not your keyword list. The gap between the two is where wasted spend lives.
Pull the last 30 days from Google Ads → Reports → Search Terms. Include at minimum: search term, campaign, ad group, impressions, clicks, cost, conversions, and match type. Export as CSV.
Create a Google Sheet with three tabs:
- Raw Input — your CSV data lands here, unchanged
- Agent Output — where processed results appear
- Existing Negatives — your current negative keyword list, used as a lookup table
The Existing Negatives tab gets more valuable over time. Every keyword the agent recommends and you approve gets added here. Future runs automatically exclude anything already handled.
Step 2: Define your filtering logic
Before the AI sees a single row, filter down to the terms actually worth reviewing. This is pure logic — no AI involved here.
Three filters to apply:
Any search term that hasn't cost you at least $5–10 in the last 30 days doesn't need reviewing yet. Adjust based on your account size.
Search terms with zero conversions and spend above your threshold are your primary candidates. Cost plus no conversion is the clearest signal something isn't working.
Any term already on your negative keyword list gets filtered out. No point reviewing what you've already handled.
Build this as a filter step inside your coding agent before it passes anything to the AI. If more than 60% of rows are passing through, tighten your spend threshold.
Step 3: Write your classification prompt
This is the one step where the AI does real work. Its job is to read each filtered search term and classify it as one of three things:
- NEGATIVE — Should be excluded. Reflects intent that won't convert.
- REVIEW — Needs human judgment. There's genuine ambiguity.
- KEEP — Don't negate. Despite low conversion data, worth keeping.
For each classification, ask for: the label, a confidence score 1–10, and a one-sentence rationale.
You are a paid search analyst reviewing Google Ads search terms
for negative keyword recommendations.
Classify each search term as NEGATIVE, REVIEW, or KEEP.
For each, provide:
- Classification
- Confidence score (1–10)
- One-sentence rationale
Context about this advertiser: [what the company sells, who buys
it, what commercial intent looks like for a converting customer]
Rules:
- Do not recommend negating terms containing the advertiser's core
product category unless spend is very high and conversions are zero
across 90+ days
- Flag competitor comparison intent as REVIEW, not NEGATIVE
- Be specific in your rationale — "low intent" is not sufficient
The context block is where this prompt gets specific to your account. Spend five minutes filling it in accurately — the AI can't make good commercial judgment calls without knowing what a real customer looks like for your business.
"classification": "NEGATIVE",
"confidence": 8,
"rationale": "Term indicates navigational intent toward a competitor."
}
Step 4: Route output to your review sheet
Set up your Agent Output tab with these columns: date processed, search term, campaign, spend, conversions, classification, confidence, rationale, human decision, and added to negatives.
Route by classification:
- NEGATIVE + confidence ≥ 7 — Top of the sheet. These you can approve in a fast scan.
- REVIEW — Middle of the sheet. These need actual judgment — don't skip them.
- KEEP — Bottom of the sheet. Ignore unless something looks wrong.
Set up a Slack or email notification each time the agent runs: number of NEGATIVE, REVIEW, and KEEP results, top three terms by spend, and a link to the sheet. Without the notification, the sheet sits unread.
Step 5: Close the loop
- High-spend accounts (>$10K/month) — weekly
- Mid-spend (1K–10K/month) — every two weeks
- Lower-spend — monthly
Want the full implementation?
Cody's open-source Google Ads agent kit — built with a full data warehouse integration, daily scheduled runs, and production-grade safety controls — is available on GitHub.