← Back to library

Find wasted spend in your Google Ads brand campaign

JJ Tham's n8n template pulls two weeks of search terms from a Google Ads brand campaign, strips your own brand names, and has Gemini sort the rest into terms that spent money without converting and terms that converted. It totals the waste and posts a Slack report with buttons for adding negative keywords.

  • OutcomeEvery couple of weeks, see which non-brand searches your brand campaign paid for, how much the zero-conversion ones cost, and which converting ones need a decision, with an approve button in Slack.
  • SetupAn afternoon+
  • LevelAdvanced
  • CreditJJ Tham
View original
Works with
n8nGemini

Published Oct 22, 2026Updated Oct 22, 2026AI dry run on sample input: passed Oct 22, 2026Source verified Oct 23, 2026

When should you use it?

  • Your brand campaign keeps matching generic searches that eat budget
  • You or your agency review search term reports by hand and fall behind
  • You want a person to approve each negative keyword before it goes live

Not for: Accounts without Google Ads API access or a developer token; Non-brand campaigns, where generic terms are the point

What do you need, and what do you get?

You need

  • An n8n instance
  • Google Ads access with manager and client IDs and a developer token
  • A short description of your brand and its brand terms
  • Gemini and Slack credentials

You get

  • A Slack report with total wasted spend for the period
  • Recommended negative keywords grouped by campaign and ad group
  • A list of converting non-brand terms to review
  • Approve buttons that hand off to a second workflow you build

How does it work, step by step?

  1. Import and connectImport the template, connect Google Ads with your manager and client IDs, and add the developer token to the API call.
  2. Name your brandEnter your brand terms in the filter step and write a two-line brand description for the AI's context.
  3. Pick the campaignPoint the campaign filter at your brand search campaign.
  4. Check one run by handRun it once, then compare the wasted-spend total and term lists against the search terms report in Google Ads.
  5. Wire the approvalBuild or connect the follow-up workflow that adds approved negatives, and keep a person clicking approve.

The prompt

The original prompt by JJ Tham, word for word, with a link to where it was published. Below it is our adapted version with fill-in blanks, if you want it. Works in n8n and Gemini. Values in lime are placeholders.

Original prompt by JJ Tham

Word for wordby JJ Tham
Act as a Google Ads SEM performance marketer. Your job is to analyze the provided data and generate a report in a standardized JSON format.

Context:
{{ $json.brand_info }}

Objective:

Analyze search term data from the company's brand campaigns over the past 14 days to identify non-brand keywords.

Your analysis must follow these strict rules:
Identify all search terms NOT directly related to the company/brand.

Categorize these non-brand terms into two groups based on the conversions metric only (ignore allConversions).

Group A (Wastage): Terms with ZERO conversions. These will be added to the negativeKeywords list.

Group B (For Review): Terms with ONE OR MORE conversions. These will be added to the keywordsForReview list.

Calculate totalAdWastageUSD using the cost from Group A only.

The output structure must be strictly followed to ensure it can be processed automatically.

Time Now: {{ $now.setZone("Asia/Singapore") }}

Output Format (Strict JSON):
Return the final result strictly in the following JSON structure. Both recommendations and keywordsForReview must always be included as arrays. If there are no items for a list, return an empty array [].

{
  "reportTitle": "string",
  "date": "YYYY-MM-DD",
  "period": "string (e.g., '2025-10-28 to 2025-11-05')",
  "totalAdWastageUSD": "number",
  "summary": "string",
  "recommendations": [
    {
      "campaign": "string",
      "campaignId": "string",
      "adGroup": "string",
      "adGroupId": "string",
      "negativeKeywords": ["string", "string"]
    }
  ],
  "keywordsForReview": [
    {
      "searchTerm": "string",
      "campaign": "string",
      "adGroup": "string",
      "costUSD": "number",
      "conversions": "number",
      "reason": "string"
    }
  ]
}

Exactly as published by JJ Tham in Automate Google Ads search term analysis with Gemini AI and send to Slack.

Our adapted version (optional)

Fill in the blanks (optional; the copied prompt uses your values)

Adapted prompt4 variables
You review search terms from a Google Ads brand campaign for {brand}. Brand terms and common misspellings: {brand_terms}.
Period: {date_range}. Data (search term, campaign, ad group, cost, conversions):
{search_terms}

Ignore anything that is our brand or a misspelling of it. Sort the remaining terms using the conversions column only:
- Waste: zero conversions. Suggest each as a negative keyword under its campaign and ad group, and add up their cost.
- Decide: one or more conversions. List them with cost, conversions and a one-line reason a person should look.
Flag competitor names separately instead of treating them as waste.
Return JSON with period, total_waste, summary, negatives (by campaign and ad group), review_terms and competitor_terms. Use empty lists when nothing applies. Do not change anything in the account.

What can go wrong?

  • The model can misjudge brand misspellings or product names as generic; add them to your brand list and review the negative list before approving.
  • Conversions can arrive days late; a term with zero conversions in 14 days may still convert, so do not exclude borderline terms on one report.
  • The prompt's time zone is set to Singapore in the template; change it to yours.
  • Adding a competitor's name as a negative is a strategy decision, not just a cleanup step.

Our take

A focused, useful automation for anyone paying for brand search. Brand campaigns are supposed to be cheap and efficient, yet loose match types quietly let generic searches in, and nobody notices until the monthly review. What we like here is the split: zero-conversion non-brand terms become proposed negatives, converting ones go to a person, and nothing changes in the account until someone clicks approve. We ran the Gemini prompt word for word on a synthetic export for a fictional coffee roaster with eight terms, including a misspelled brand search and a term with an assisted conversion but no direct one. The JSON parsed, the five wasted terms summed correctly to $128.35, both converting terms went to review, and the misspelling was left alone as brand traffic. Before you trust it, change the hard-coded Singapore time zone, extend the window if your conversions lag, and decide separately whether you want competitor names as negatives.

Where the time goes back: Mining search term reports by hand takes an hour per account; this delivers the totals and a short list to approve in a message you read in two minutes.

FAQ

Does it add negative keywords automatically?
No, the Slack buttons send the approved list to a separate workflow, which you build or connect yourself.
Why only zero-conversion terms?
The prompt treats non-brand terms with no conversions as waste and sends any that converted to a review list, so you never block a term that is making money.
Can I use another model?
Yes, n8n lets you swap the Gemini node for another chat model; recheck that the JSON output still parses.

Source and credit

The original prompt on this page is by JJ Tham, shown word for word with a link to where it was published. The summary, notes and adapted version are ours.

Original
Automate Google Ads search term analysis with Gemini AI and send to Slack
Creator
JJ Tham
Published on
n8n workflow templates
Original date
Nov 11, 2025
License
Not openly licensed; the original prompt is shown word for word with credit and a link to the original
Originally for
n8n
AI dry run
Oct 22, 2026: passed. Dry-run tested by our AI test agent on sample input. Arithmetic and classification correct; time zone in the template is hard-coded to Asia/Singapore (noted in pitfalls).
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Marketing

All 97 Marketing playbooks →

Related playbooks

MarketingWorkflow✓ AI dry run

Gate AI marketing with a quality score and spend caps

Score every generated post before it publishes and put hard budget ceilings on any agent that can touch ad spend.

Credit: u/ProbablyCh on r/buildinpublic

An afternoon+
MarketingWorkflow✓ AI dry run

Get fixes for pages that lost Google traffic last month

Every Monday, the pages that lost clicks and rankings in Search Console arrive in Slack with the reason, three new title ideas and the one missing section to add.

Credit: Shun Nakayama

Under an hour
MarketingWorkflow✓ AI dry run

Feed agents approved templates when making video ads

Give a marketing agent a library of manually approved examples so generated videos and posts follow formats that worked.

Credit: u/tgdn on r/ClaudeAI

An afternoon+
MarketingWorkflow✓ AI dry run

Write hundreds of landing page headlines with two agents

Point two coding agents at the same customer research (chat logs, call transcripts and your best ads), have each draft a large batch of headline and subheadline options, collect them in a simple review app where you swipe and leave notes, then narrow the pile yourself to a short list for split testing.

Credit: James Camp (@JamesonCamp)

An afternoon+
MarketingWorkflow✓ AI dry run

Split SEO article writing into stages with a fact-check

Run research, outline, draft, fact-check and polish as separate agent stages so made-up claims are caught before publishing.

Credit: u/GonkDroidEnergy on r/Agentic_SEO

An afternoon+