Harpy Guide

N-Gram Mining — The Search-Term Layer You're Missing

14 min read · Harpy Media

Break your search terms into words, aggregate performance, and find the themes silently draining budget — then kill them permanently with negative phrase matches.

Part 1

What are n-grams?

Every Amazon advertiser reads their search term report: “silicone baking mat large,” “steel cookie sheet non stick,” “rubber oven mat heat resistant.” Decisions happen one term at a time — negate this, keep that, adjust this bid. And most advertisers miss the forest for the trees, because an entire layer of insight sits inside that data and only becomes visible when you break terms into their component words and aggregate performance across every appearance of each word.

That layer is n-gram analysis. An n-gram is simply a contiguous sequence of n words. A unigram is one word (“silicone”), a bigram is two consecutive words (“baking mat”), a trigram is three (“silicone baking mat”). Apply the idea to a search term report and you decompose every term into its word-level components, then sum spend, clicks, impressions, orders, and revenue across every search term containing each component.

“stainless steel water bottle insulated” → unigrams: stainless · steel · water · bottle · insulated  |  bigrams: stainless steel · steel water · water bottleEvery n-gram inherits the full metrics of its parent search term — then aggregates across all appearances

Why does word-level analysis change everything? Because complete search phrases are often unique — searched once, never again. You can't make statistical decisions from one or two data points. But the words inside those phrases repeat constantly. “Steel” might appear in two hundred search terms; each spent a dollar or two; no single one flags as a problem. Collectively, they can burn hundreds with zero orders — invisible at the term level, obvious at the word level. One negative phrase match eliminates all of them in a single move.

Part 2

Why n-gram analysis works

Death by a thousand cuts — the real shape of waste

Most wasted spend doesn't come from a few big, obviously bad search terms. It comes from hundreds or thousands of low-spend, individually invisible terms sharing a common theme. Imagine a silicone baking mat seller with a 3,000-row search term report: the top 50 by spend get optimized, a few obvious irrelevants get negated, the cleanup feels done — while rows 51 through 3,000 hide 187 terms containing “steel,” each spending a dollar or five, none converting, adding up to real money every month. No amount of one-by-one scrolling reliably finds that.

Standard search term reviewN-gram analysis
Reads complete terms one by oneBreaks terms into words, aggregates all appearances
Sorts by spend — low-spend terms vanish from viewSurfaces patterns regardless of individual term spend
Negates single terms; new variations keep appearingOne negative phrase blocks all current and future variations
Slow, incomplete, whack-a-moleSystematic, permanent cleanup

Negative exact vs. negative phrase — the leverage

Negating an individual term uses negative exact: blocks that one search, nothing else. Tomorrow a slightly different variation of the same irrelevant theme triggers your ads again. But when n-gram analysis shows a word is categorically irrelevant, you apply a negative phrase — blocking every search, current and future, that contains it. Negative exact “steel baking mat” blocks one term; negative phrase “steel” blocks an entire theme. That's the difference between playing defense and playing offense.

What n-gram analysis is NOT for

⚠️ Watch out. N-gram analysis finds irrelevant themes — nothing else. A word showing high ACOS may be perfectly relevant and just need a bid change. It reveals what to block, not what to target. And on thin accounts ($500/month, a couple hundred terms), manual review is fine — there isn't enough data for patterns to emerge. The relevancy rule still applies: high ACOS means adjust the bid; irrelevant means negate.

Part 3

The step-by-step process

The complete workflow, from raw export to applied negatives:

1. Export the search term report.60–90 days for most accounts (30 for high spend). Columns: customer search term, impressions, clicks, spend, orders, sales, campaign name — you'll need the campaign to know where to apply negatives.
2. Clean the data.Remove your own brand terms (you won't negate your brand), drop ASIN/product-targeting rows, deduplicate terms that appear across campaigns into single rows, optionally filter out zero-click noise.
3. Break terms into n-grams.Split every search term into unigrams, bigrams, trigrams. Each n-gram inherits its parent term's full metrics.
4. Aggregate per n-gram.Group by n-gram and sum impressions, clicks, spend, orders, revenue. Add an appearance count.
5. Analyze.Sort by spend. High spend + zero/low orders + irrelevant = candidate.
6. Apply negative phrase matches.One phrase blocks all variations, at the right level (Part 6).
7. Validate and monitor.Check for false positives, watch ACOS move.
💡 Tip. Scope matters: run it account-level for the broadest patterns, campaign-level for product-specific irrelevancy. Start broad for the biggest wins, then narrow.
🔑 Key insight. The metrics are additive. A word appearing in 200 search terms shows the summed spend, clicks, and orders of all 200. That aggregation — collective impact instead of fragments — is the entire power of the method.

Part 4

Building the analysis sheet

Excel, Google Sheets, Python, or a pre-built tool — the output structure is the same:

N-gramTypeAppearancesClicksSpendOrdersACOSRead
steelunigram187412$6120∞🚫 pure waste
stainlessunigram143298$44112,323%🚫 waste
metalunigram94189$2770∞🚫 waste
siliconeunigram4892,341$3,10231250%✅ working
bakingunigram5212,189$2,89128750%✅ working
matunigram6123,012$4,11240151%✅ working

(Illustrative rows.) Read that table the way the method intends: “steel,” “stainless,” and “metal” — three words that would never jump out of a term-level report — collectively explain over $1,300 of spend with essentially zero return. Three negative phrases end it.

Three ways to build it

Spreadsheet: split each term with =SPLIT() or Text-to-Columns, build a master list of unique words, and aggregate with SUMPRODUCT + SEARCH — summing each metric for every row containing the word. Mind that SEARCH matches substrings (“mat” inside “material”); wrap the word in spaces for whole-word matching. Python: for scale — split each term, emit a row per n-gram, group-and-sum, export. Seconds of runtime on tens of thousands of rows. Tools: several PPC platforms now build this in; a good one shows aggregated metrics per n-gram (not a word cloud), filters by n-gram type, drills down to underlying terms, and exports. The tool doesn't matter — the methodology does.

N-gram typeBest forRisk
UnigramsBroad irrelevant themes — materials, categories, gendersHigher — single words can over-negate
BigramsSpecific irrelevant products or attribute pairsMedium — more context, fewer false positives
TrigramsConfirming very specific patternsLow — targeted but misses broad patterns
💡 Tip. Start with unigrams for the broad view and the biggest immediate wins. Move to bigrams when a unigram is too broad to negate safely. Trigrams are for validation, rarely for primary negatives.

Part 5

Interpreting n-gram data

The three-column decision framework

SpendOrdersRelevant?Action
HighZero / very lowNoNegative phrase match — immediate
HighZero / very lowYesBid down — the word works, the price is wrong
HighHighYesLeave it / optimize bids — this is working
LowZeroNoNegate if easy — low priority cleanup
LowZeroYesIgnore — not enough data to act on

The critical column is Relevant? — and that requires the human who knows the product. No automation answers “is this word fundamentally relevant to what we sell?” for you.

⚠️ Watch out. The cardinal sin: negating on ACOS alone. A unigram at 200% ACOS may mix relevant and irrelevant terms — negating the word kills the good traffic with the bad. Always drill into the actual search terms containing the n-gram first. The question is never “is this profitable?” — it's “is this relevant?”

The drill-down — 30 seconds that prevents expensive mistakes

Before negating any n-gram, list the search terms containing it. The classic pattern: “glass” shows 78 appearances, $234 spend, 2 orders. Drill down and 76 of those terms are wrong-material searches — glass baking dish, glass cookie sheet, tempered glass cutting board — while two (“silicone mat for glass table”) are genuinely relevant. Verdict: negate, because two niche terms don't justify the waste. But sometimes the drill-down flips the call: if half the terms are relevant, don't negate the unigram — move to bigrams for the surgical version.

Ambiguous words

“Large” might matter to your large mat or attract searchers wanting something bigger than you sell. “Kids” is essential in kids' campaigns and poison elsewhere. For ambiguous words: move to bigrams (“large steel” is clearly wrong where “large” alone isn't), apply negatives at campaign or ad group level rather than account-wide, and when genuinely in doubt, don't negate — wasting a little on a borderline term beats killing a converting keyword.

🔑 Key insight. The 80/20 of n-grams: roughly 80% of wasted spend concentrates in the top 10–15 irrelevant n-grams. Clean those and stop. The marginal returns fall off a cliff after the big wins.

Part 6

Creating negative phrase matches

The decision tree

1. Categorically irrelevant?Would any search containing this word be irrelevant? Then apply it as a negative phrase — blocks all current and future terms containing it.
2. Irrelevant only in combination?The word alone is fine but paired with something it's always wrong — use the bigram as the negative (“stainless steel” instead of “steel” if “steel wool” is relevant to you).
3. Relevant to some products, not others?Apply at ad group or campaign level, not account-wide — blocked where it's wrong, preserved where it converts.

Where to apply

LevelWhenExample
Account (negative keyword list)Universally irrelevant — no product should show for it“wholesale” for a B2C brand
CampaignWrong for every product in this campaign, fine elsewhere“kids” in your adult-product campaign
Ad groupWrong for this one product, fine for siblings“small” in the large-size ad group of a mixed campaign

Implementation hygiene

Deploy via bulk upload (campaign, ad group, keyword text, match type = negative phrase, state = enabled), or themed negative keyword lists for account-level words — “material negatives,” “category negatives,” “competitor negatives.” Double-check every entry: a typo in a negative phrase blocks the wrong traffic silently. And after upload, spot-check that the negatives actually applied.

⚠️ Watch out. Amazon does not support negative broad match. Your options are negative exact and negative phrase only. Negative phrase blocks any search containing your phrase in order — exactly the mechanic n-gram negation needs. Don't import intuitions from positive broad match; the mechanics are unrelated.

Part 7

The patterns you'll find

After enough n-gram passes, the irrelevancy themes repeat across completely different products. These are the categories to expect:

PatternWhat it looks like
Material mismatchYou sell silicone; searches carry steel, metal, glass, ceramic, wooden. The most common and usually the biggest win
Category driftYou sell baking mats; searches bring yoga mat, car mat, door mat. Bigram negatives are the fix
Size / spec mismatch“Commercial,” “industrial,” “mini” — searchers want a fundamentally different grade than you sell
Gender / age mismatch“Men's” on women's products; “kids” on adult products; “baby” below your age range
Brand leakageCompetitor names in your terms — negate the ones you'll never convert on (strong-loyalty brands)
Intent mismatch“How to,” “DIY,” “recipe” — informational traffic that rarely buys
B2B / B2C mismatch“Wholesale,” “bulk,” “supplier” hitting a B2C listing — or the reverse

The dog-food version of the species problem makes the drill-down rule vivid: “cat,” “bird,” “hamster” are safe unigram negatives for a dog food brand — but “fish” is a trap, because “fish flavor dog food” is relevant while “fish tank” is not. The n-gram flagged the word; the drill-down saved the converting terms; bigram negatives (“fish food,” “fish tank”) removed the waste surgically. The data gives you candidates; judgment makes the call. And the waste isn't always about wrong products — wrong contexts show up too: “office” and “commercial” on kids' furniture, “outdoor” on indoor-only lines, “vintage” on a modern brand.

Part 8

Cadence, maintenance, and the positive side

How often to run it

Account stageFrequencyWhy
New account / onboardingDay oneInherited accounts are full of entrenched waste patterns — the first pass finds the most
First 3 monthsMonthlyNew campaigns are ramping; catch patterns before they accumulate
Steady stateQuarterlyNew waste slows after cleanup; quarterly catches seasonal shifts and new products
After major changes2–4 weeks laterNew launches, campaigns, or big bid changes invite new irrelevant traffic

The first analysis on any account is always the most impactful — patterns that have been leaking money for months or years, invisible at term level. Every pass after finds less. That's the method working.

Advanced tactic — bigram layering

When a unigram is too broad to negate but several bigrams built on it are all wrong, layer them: you sell baking mats, “rack” is too broad (cooling rack matters), but dish rack, wine rack, spice rack, shoe rack, towel rack are all wrong. Five bigram negatives approximate the unigram without the false-positive risk.

Advanced tactic — cross-campaign comparison

Run the analysis separately on brand, non-brand, and competitor campaigns. You'll find brand campaigns picking up competitor names (negate them there), non-brand campaigns picking up your own brand (negate to keep data clean), and competitor campaigns leaking generic terms (tighten). It's the audit that verifies your brand/non-brand separation is actually holding.

The positive side — discovery

The same table that finds waste finds strength. N-grams with high orders and low ACOS are your best-converting word themes — are you running exact keywords on them? High impressions with low clicks flag themes where your images and title aren't earning the click. New n-grams that didn't exist last quarter can flag emerging demand worth getting ahead of.

🔑 Key insight. N-grams work both ways. If “organic” appears across hundreds of your converting search terms at a strong ACOS, that word tells you exactly what shoppers value about your product — and where to double down in copy, A+ content, and targeting.

The principles that make it work: aggregate, don't isolate — individual terms lie, aggregated words tell the truth. Relevancy is the only negation criterion. Phrase match is the power tool. Always drill down before negating. Start broad, get specific. One negative phrase, found through n-grams, can cut more waste than a month of manual review — and if you'd like that first pass run on your search terms, the diagnosis is free.

Want this run on your account instead? The first diagnosis is free.

Book Free Consultation

New guides, straight to your inbox.

Practical D2C playbooks as we publish them. No fluff, no spam — unsubscribe anytime.