Skip to main content

Analyze Google Ads search terms and get negative keyword suggestions with OpenAI GPT-5.4-mini

Workflow preview

Workflow preview
100%
Analyze Google Ads search terms and get negative keyword suggestions with OpenAI GPT-5.4-mini preview
Open on n8n.io

1. Workflow Overview

Who is this template for? This workflow is built for PPC managers, digital marketing agencies, and in house marketing teams who run Google Ads search campaigns and want to stop wasting budget on ir...

Best for

  • Market Research automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.set, n8n-nodes-base.googlesheets, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.manualtrigger, n8n-nodes-base.scheduletrigger, @n8n/n8n-nodes-langchain.chainllm

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Zeljislav Petrovic.

Original n8n.io source

1.1 Workflow description

Title
Analyze Google Ads search terms and get negative keyword suggestions with OpenAI GPT-5.4-mini
Workflow name
Analyze Google Ads search terms and get negative keyword suggestions with OpenAI GPT-5.4-mini

Who is this template for?

This workflow is built for PPC managers, digital marketing agencies, and in-house marketing teams who run Google Ads search campaigns and want to stop wasting budget on irrelevant queries. Instead of manually reviewing hundreds or thousands of search terms in spreadsheets, this template automates the entire analysis pipeline — from raw Google Ads data to a fully structured, AI-analyzed search terms report with actionable keyword exclusion and inclusion recommendations, saved directly to Google Sheets.


What this workflow does

This n8n workflow connects the Google Ads API, an OpenAI chat model, and Google Sheets to deliver a production-ready search term intelligence pipeline that runs automatically every 30 days — or on demand:

  1. Pulls search term data directly from Google Ads — using the Google Ads API (GAQL searchStream), the workflow fetches every search term that triggered an ad in the last 30 days, including campaign and ad group context, matched keyword, match type, search term status (Added / Excluded / None), and full performance metrics: impressions, clicks, CTR, cost, avg CPC/CPM, conversions, conversion rate, and cost per conversion

  2. Cleans and formats the dataset for AI — a Code node normalizes and filters raw API data: formats currency and percentage values, applies a metrics threshold filter, and structures the data as a clean input for the AI model

  3. Runs a comprehensive AI analysis on every search term — an OpenAI chat model (GPT-5.4-mini or any LLM supported by n8n) acts as a senior PPC strategist. For each term, it outputs:

  • Intent signal — Transactional, Commercial, Informational, or Navigational
  • Relevancy — on a 5-level scale from Directly Relevant to Directly Irrelevant
  • Relevancy reasoning — a specific, business-context-aware explanation referencing campaign fit, intent, and performance signals
  • Exclusion suggestion — exact negative keyword with correct match type syntax (broad, phrase, or exact)
  • Exclusion level — Account, Campaign, or Ad Group
  • Priority for exclusion — High, Medium, Low, or N/A
  • Inclusion suggestion — keyword to add with recommended match type
  • Inclusion type — New keyword, New ad group, or New campaign
  • Inclusion level — Account, Campaign, or Ad Group
  1. Generates a Recommended Global Exclusions list — the AI distills patterns across the full dataset into a grouped negative keyword list, organized by theme (e.g. Informational/Zero-Intent Modifiers, Price/Deal Seeking Terms, Job Seeker Terms, Wrong Audience Terms), ready for direct upload to Google Ads shared lists

  2. Produces an Inference Summary — the AI documents its assumptions from business context and search terms dataset and how they influenced the analysis

  3. Saves everything to Google Sheets automatically — a new spreadsheet is created on every run with three sheets: Search Terms Analysis, Global Exclusions List, and Inference Summary


What you get in the output

A new Google Spreadsheet is automatically created on every wokflow run, named after your company and timestamped: "Search Terms Analysis & Keyword Exclusion/Inclusion Suggestions (Company Name — DD/MM/YYYY HH:MM)"

📊 Search Terms Analysis

The complete, AI-enriched analysis table. Every search term from the report is included — no filtering, no omissions. All original Google Ads columns are preserved, with AI-generated columns appended:

  • search_term, status, campaign, ad_group, matched_keyword, match_type
  • impressions, clicks, ctr, cost, avg_cpc, avg_cpm, conversion_rate, cost_per_conversion
  • intent_signal — Transactional / Commercial / Informational / Navigational
  • relevancy — 5-level scale
  • relevancy_reasoning — specific AI explanation per term
  • exclusion_suggestion — negative keyword with match type syntax
  • exclusion_level — Account / Campaign / Ad Group
  • priority_for_exclusion — High / Medium / Low
  • inclusion_suggestion — keyword to add with recommended match type
  • inclusion_type — New keyword / New ad group / New campaign
  • inclusion_level — Account / Campaign / Ad Group

🚫 Global Exclusions List

Grouped negative keywords identified as universally or near-universally problematic across campaigns. Each entry includes the negative keyword with correct match type formatting, its thematic group, and the rationale for account-level exclusion.

📋 Inference Summary

Documents any assumptions the AI made when business context fields were incomplete or ambiguous — useful for auditing the AI's reasoning and improving the Set node configuration over time.


How to set up

  1. Google Ads API — ensure you have a Developer Token in your Google Ads MCC account and set up OAuth 2.0 credentials with the required Google Ads API scopes
  2. OpenAI — add your OpenAI API key to the AI model node credentials
  3. Google Sheets — connect your Google account via OAuth 2.0. A new spreadsheet is created automatically on each run — no manual sheet setup required
  4. Configure the Set node — open the "Set Google Ads IDs & business context" node and fill in your Google Ads MCC ID (leave blank if accessing directly), Customer ID, Developer Token, and all business context fields: company name, website, industry, company overview, target audience, campaign goals, key offerings, and known irrelevant topics
  5. Activate the workflow — the schedule trigger runs automatically every 30 days. Use the manual trigger for on-demand analysis

Requirements

  • n8n (cloud or self-hosted)
  • Google Ads account with API access and a Developer Token
  • Google Ads OAuth 2.0 credentials
  • OpenAI API key (GPT-4.1-mini or higher recommended)
  • Google account with Sheets access

How to customize this workflow

  • Change the AI model — swap GPT-5.4-mini for Claude, Gemini, or any LLM supported by n8n
  • Adjust the date range — modify the DURING LAST_30_DAYS clause in the GAQL query to use a custom range (e.g. last 7 days, last quarter, current month)
  • Change the schedule trigger interval — edit the trigger interval to run the workflow weekly, monthly, or on any custom schedule
  • Change the metrics threshold — the Clean & Format node has a metrics filter that excludes terms with fewer than 5 impressions and 0 clicks; adjust the threshold to match your account's activity level
  • Add Slack or email notifications — append a notification node at the end to alert your team when a new analysis is ready
  • Customize the AI business context — the quality of AI analysis scales directly with the richness of the business context provided in the Set node; the more specific the company overview, target audience, and known irrelevant topics, the more precise the relevancy scoring
  • Connect to Google Ads for direct upload — extend the workflow to push approved exclusions back to Google Ads shared negative keyword lists via the Google Ads API

About the creator

Built by a digital marketing and automation specialist. For questions, advanced customizations, or custom n8n workflow solutions, feel free to reach out on LinkedIn.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - GPT 5.4-mini

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 2 - Set Google Ads IDs & business context

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Save global exclusion suggestions

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 4 - Extract & format search terms analysis table

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Fetch search terms data from Google Ads

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 6 - Clean & format fetched data for AI

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Execute workflow manually

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 8 - Execute workflow every 30 days

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 9 - Analyze search terms & suggest keyword exclusions/inclusions

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 10 - Save search terms & exclusion/inclusion suggestions

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - Extract & format global exclusions list

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Extract & format search terms inference summary

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Save inference summary

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 19 - Create spreadsheet for storing analyzed search terms

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

3. Summary Table

Workflow Analyze Google Ads search terms and get negative keyword suggestions with OpenAI GPT-5.4-mini
Complexity advanced
Nodes 19
Categories Market Research, AI Summarization
Author Zeljislav Petrovic
Published 29 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15385/15385.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Analyze Google Ads search terms and get negative keyword suggestions with OpenAI GPT-5.4-mini do?

Who is this template for? This workflow is built for PPC managers, digital marketing agencies, and in house marketing teams who run Google Ads search campaigns and want to stop wasting budget on ir...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research, AI Summarization use case.