TwoSquaresTwoSquares
ContactFree Audit
ENBG
  1. Home
  2. Scripts
  3. Search Term N-Gram Waste Finder
Back to scripts

Search Term N-Gram Waste Finder

Aggregates expensive non-converting n-grams from search terms to speed up negative keyword decisions.

search-termsn-gramnegatives

Script Details

Name
Search Term N-Gram Waste Finder
Author
Kiril Ivanov
Updated
2026-02-27

Script Code

Fast way to detect recurring low-intent fragments across many waste terms instead of reviewing one term at a time.

Preview is public. Unlock full code with name and email.

/**
 * ==========================================================
 * Search Term N-Gram Waste Finder
 * ==========================================================
 * Description: Aggregates non-converting spend by repeated
 * n-gram patterns for negative keyword review.
 *
 * Copyright (c) 2026 TwoSquares. All Rights Reserved.
 * Developed by Kiril Ivanov
 */
function main() {
  var SPREADSHEET_URL = "";
  var SHEET_NAME = "NGram Waste";
  var LOOKBACK_DAYS = 30;
  // ... preview shortened
}

About This Script

Search Term N-Gram Waste Finder groups search-term waste into repeated word patterns (1-3 grams), helping teams identify scalable negative opportunities. It is ideal for broad and phrase traffic where waste appears as recurring fragments across many queries.

The script aggregates clicks, cost, and conversions at n-gram level, then ranks by spend so the most expensive patterns are reviewed first.

Like your other scripts, spreadsheet handling is robust: blank URL creates a new sheet automatically, provided URL writes to existing file and creates the tab if needed.

Implementation Notes

  1. Set MIN_CLICKS, MIN_COST, and MAX_CONVERSIONS to define waste criteria.
  2. Keep STOPWORDS tuned to avoid noisy filler words.
  3. Leave SPREADSHEET_URL blank to auto-create output sheet, or set an existing URL.
  4. Review top n-grams and turn qualified patterns into negatives after manual validation.

More Scripts In This Library

Previous Script

Search Rank Lost Impression Share Monitor

Next Script

Search Term Waste Finder

Negative Keyword Conflict Checker

Flags potential conflicts where converting search terms may be blocked or constrained by existing negative keywords.

Search Term Waste Finder

Finds high-cost, non-converting search terms, prioritizes them by wasted spend, and can send an optimization digest by email.

Duplicate Query Conflict Finder

Finds search terms appearing across multiple campaigns/ad groups so you can reduce overlap and cannibalization.

MCC Negative Keyword Conflict Checker

Runs across manager-account children, compares enabled keywords to campaign and ad group negatives, and exports likely conflicts into Google Sheets.

Search Term N-Gram Waste Finder FAQs

Common setup, usage, and troubleshooting questions for this script.

Dominate your market. Own your growth.

Let's build measurable growth together.

Get Free Audit
TwoSquares

Full-service digital growth agency. SEO, PPC, paid social, GEO and web development for UK brands ready to scale.

ENBG

Ask AI about TwoSquares

ChatGPT
Perplexity
Grok
Claude
Gemini

Services

  • SEO
  • GEO
  • PPC
  • Paid Social
  • Email Marketing
  • Web Design & Dev
  • CRO
  • Strategy & Planning
  • Consultancy
  • Custom Solutions

Solutions

  • AI Search Growth System
  • Demand Generation & Lifecycle
  • Pay-Monthly Websites

Audits

  • PPC Audit
  • SEO Audit
  • GEO Audit
  • Website Audit
  • Full Marketing Audit
Featured on Best in Britain

Company

  • About Us
  • Our Brands
  • Blog
  • Contact
  • Case Studies
  • Careers
  • Templates

Resources

  • Resources Hub
  • AI Readiness Toolkit
  • SEO Glossary
  • Free Tools

Industries

  • Hotels & Resorts
  • Property & Rentals
  • Restaurants & Bars
  • E‑commerce & DTC

Connect

[email protected]
SSL Secured
GDPR Compliant

© 2026 TwoSquares Limited (SC877356). All rights reserved.

Privacy PolicyTerms of ServiceCookie PolicySitemap

TWOSQUARES