Skip to content
Faisal Mahmud TusherDigital marketing, SEO & analytics
with Faisal Tusher

Google Ads & PPC › Search Campaigns

Search Term N-Gram Analysis

How to run an n-gram analysis of Google Ads search terms: split queries into words and phrases, total their cost and conversions, and act on waste and winners.
Tutorialadvanced10 min readUpdated

What an n-gram view shows that the report does not

An n-gram is a run of n consecutive words. The query "cordless drill battery replacement" contains four single words (unigrams), three two-word phrases (bigrams) and two three-word phrases (trigrams). Splitting every query in a period this way and totalling the metrics for each n-gram turns a list of unique queries into a list of recurring themes.

The input is the report the glossary's search terms report entry describes: the actual searches that triggered the account's ads, with the keyword that matched each one. The search campaigns hub shows where that report sits among the keywords, ads and bids it describes.

That matters because of the shape of search demand. Most queries in a search terms report are long-tail: specific, rare and each worth little. A word that signals the wrong intent rarely appears in an expensive single query; it appears in many cheap ones, each below the point at which a weekly review would act. The negative keywords guide reads the report row by row, which catches the costly mistakes; the n-gram view catches the pattern spread across rows. It works in the other direction too: a phrase that converts across dozens of queries, none of them a keyword, is a candidate for its own keyword, ad group and headline.

N-gram sizeExample from "cordless drill battery replacement"What it revealsCaution
Unigram (one word)cordless, drill, battery, replacementSingle words that signal intent: free, jobs, used, manual, cheapCommon words carry everything; ambiguous words need their phrases read
Bigram (two words)cordless drill, drill battery, battery replacementProduct and need phrases; the wording people actually useTotals overlap heavily with the unigrams inside them
Trigram (three words)cordless drill battery, drill battery replacementSpecific needs that can become ad groups or landing pagesThin volumes; useful mainly in large accounts

Two limits frame every result. The analysis sees only what the report shows, and the negatives guide notes that Google withholds low-volume searches and groups them as other search terms, so some spend is never visible at query level. And the totals overlap: a query counts once in each of its n-grams, so the n-gram totals add up to far more than the account's total. Compare each n-gram with your targets and with the other n-grams, never with the account total.

Before you start

  • Access to the search terms report for the search campaigns in scope, with permission to add negatives and keywords afterwards. Read-only access is enough for the analysis itself.
  • Your targets. The target cost per acquisition or return on ad spend each campaign is held to, and the value of a conversion if values are tracked. Thresholds come from these, not from published figures.
  • The current negative keyword lists, at account, list, campaign and ad group level, so that findings already covered are not added twice.
  • A spreadsheet or the analysis tool your team already uses, able to split text, group and sum. No specialist software is needed.
  • A note of recent changes to keywords, match types and bidding, so a pattern caused by your own edit is not mistaken for demand.
  • About two hours for the first run; later runs reuse the same workbook and are faster.

The steps

  1. Export search terms with cost and results

    Export the search terms report for the campaigns in scope with, for each query: the campaign and ad group, the matching keyword and its match type, impressions, clicks, cost, conversions and conversion value. Choose a window long enough for the account's volume to give the main n-grams a meaningful number of conversions, which might be a month in a busy account and a quarter or more in a quiet one. Leave out the most recent days, whose conversions have not all arrived, and avoid a window that straddles a major change unless that change is the subject. Export brand and non-brand campaigns separately, or tag them, because their words behave differently.

  2. Clean and normalise the terms

    Make the text consistent before splitting it. Convert to lower case, trim spaces, collapse double spaces and strip punctuation that does not change meaning. Then decide how to treat variants: plurals, spelling differences and common misspellings can be mapped to one form for counting, so that "hinge" and "hinges" are read together. Keep a record of the mapping, because the variants still matter later: Google documents that negative keywords do not match close variants, so a negative written for one form does not block the others. Keep short function words such as "for" and "to" in the text; they are noise as unigrams but meaningful inside phrases such as "how to".

  3. Split each term into words and phrases

    For every query, generate its unigrams, bigrams and trigrams. Within one query, count each n-gram once, so that a query that repeats a word does not count it twice. Carry every metric of the query across to each of its n-grams, along with the campaign and the match type of the keyword that matched it. The result is a long table with one row per query and n-gram. It is large, but it is the raw material for every later step.

  4. Total cost, clicks and conversions per n-gram

    Group the long table by n-gram and sum impressions, clicks, cost, conversions and conversion value. Add a count of distinct queries for each n-gram, which shows whether a theme is broad or rests on one query, and derive cost per click, conversion rate and cost per conversion or return on spend. Sort by cost. Keep unigrams, bigrams and trigrams in separate tabs, because a bigram's total is part of the total of each word inside it and the lists are easier to read apart. Filter out function words as unigrams at this point.

  5. Set thresholds from your own targets

    Decide in advance what makes an n-gram worth reviewing, using the account's own economics. A simple rule for a cost goal: flag any n-gram whose cost without a conversion exceeds your target cost per acquisition, or a multiple of it you choose, and any n-gram whose cost per conversion is well above target on enough clicks to judge. For a value goal, flag n-grams whose return falls below the break-even or target return. The CPA calculator gives the maximum cost per acquisition from customer value and conversion rate if the target itself is in doubt. Write the thresholds down before reading the lists, so the decisions are not shaped by which words look suspicious.

  6. Flag n-grams that waste money

    Read down the sorted lists and mark every n-gram that crosses the waste threshold. Group what you find by reason: wrong intent (free, jobs, course, how to, manual), wrong product (used, rental, repair for a seller of new goods), wrong place (towns or regions outside the service area), and wrong audience (trade terms in a consumer shop, or the reverse). Note for each the campaigns and match types it appears under. A wasteful word concentrated in broad match points to a match type question as well as a negative, which the irrelevant search terms diagnosis helps trace to its cause.

  7. Flag n-grams that convert

    Now read the same lists for the opposite pattern: n-grams whose cost per conversion is well inside target on meaningful volume, especially those spread across many distinct queries. Check whether each is already a keyword or the theme of an ad group. A converting phrase that is not a keyword is riding on whatever matched it, with an ad and a bid written for something else. Note also the descriptive words that recur among converting queries, such as materials, sizes, finishes or urgency; they are the language searchers use and the raw material for headlines.

  8. Read full terms before acting

    For every flagged n-gram, filter the original export to the queries that contain it and read them. This step prevents most of the damage an n-gram analysis can do. A word that looks wasteful as a unigram may be valuable in a particular phrase: "free" in "free delivery" is a buying signal, "free" in "free plans" is not. A phrase that looks like a winner may rest on one query that happens to contain it. Check conversion lag for slow-buying products before calling an n-gram wasteful, and check the negatives guide's caution on over-blocking: a word with two meanings blocked everywhere will block something wanted somewhere.

  9. Turn findings into negatives, keywords and ad copy

    For wasteful themes, choose the negative's form deliberately. Google documents that a broad match negative blocks searches containing all of its words in any order, a phrase match negative blocks the words in that order, and an exact match negative blocks only that exact search, and that none of them extends to close variants. So a single word that is unwanted in every context becomes a broad negative, with its plural and misspellings listed; a word that is wanted in some phrases becomes phrase negatives for the wasteful phrases only. Place each at the level the negatives guide describes: shared lists for universal waste, campaign negatives for steering. For winning phrases, add them as keywords with the control the keyword match types guide recommends for the goal, give a distinct theme its own ad group and landing page, and move the converting language into headlines. Record every change with the n-gram that justified it.

  10. Repeat on a schedule and compare

    Rerun the analysis monthly in a busy account and quarterly in a quiet one, with the same workbook and thresholds. Compare the share of cost on flagged n-grams with the last run: it should fall after the negatives went in, and new wasteful words show up first as newcomers to the top of the list. Check the keywords and ad groups added for winners against their own targets. Run it again after any widening of match types, because broad match brings new words into the account; the broad match expansion test reads irrelevant spend as a guardrail, and an n-gram table is a quick way to see where that spend went. The account audit repeats the search terms reading for Performance Max search terms insights where available; this tutorial stays with search campaigns.

The analysis sits between the weekly review and the structural choices about match types. Where it keeps finding the same wasteful themes in broad match keywords, the broad match versus exact match comparison sets out when a narrower default is the better answer than another list of negatives.

An n-gram table, read (illustrative)

Illustrative example — not a real result

A hardware shop splits a quarter of search terms

Teaselbolt Hardware, an invented online hardware shop, exports a quarter of search terms from its non-brand campaigns: 11,900 distinct queries, £14,800 of spend and 610 conversions, against a target cost per acquisition of £25. Its threshold flags any n-gram with more than £25 of cost and no conversion, and any n-gram above £40 per conversion on at least 100 clicks. Part of the result:

N-gramDistinct queriesClicksCostConversionsCost per conversion
how to212640£3522£176
free96520£2863£95
manual74330£1980none
spare parts58290£2314£58
brass hinges41610£21421£10
soft close67480£26219£14

Reading the full queries changes two decisions. Behind "free", the three conversions all came from "free delivery" searches, so the team adds phrase negatives for "free plans", "for free" and "free template" rather than blocking the word. Behind "how to", a handful of fitting queries for soft-close hinges converted, so "how to" goes in as a phrase negative on the tools campaign only. "Manual" becomes a broad negative in the shared list with "manuals". "Spare parts" turns out to be mixed, half appliance parts the shop does not sell and half fixings it does, so it stays on the watch list for the next run. "Brass hinges" earns its own ad group with phrase and exact keywords and headlines naming brass hinges, and "soft close" becomes a headline across the hinges ad groups. The next quarter's run shows the four flagged themes down from £1,067 to £290 of spend, and the brass hinges ad group at £12 per conversion.

Common mistakes

  • Reading n-gram totals against the account total. A query counts in every n-gram it contains; the totals overlap by design.
  • Blocking a word without reading its queries. "Free" in "free delivery" is a buyer.
  • Forgetting that negatives have no close variants. Normalising "hinge" and "hinges" for counting does not mean one negative blocks both.
  • Setting thresholds after looking. Rules written in advance stop the list being shaped by hunches.
  • Judging recent days. Conversions arrive late; leave the newest days out of the window.
  • Finding winners and leaving them in broad match. A converting phrase deserves its own keyword, ad and bid.
  • Running it once. The value is in the comparison between runs, which shows whether the changes held.

Frequently asked questions

How is an n-gram analysis different from the weekly search terms review?

The weekly review reads queries one by one, sorted by cost, and catches the expensive mistakes. An n-gram analysis adds the queries up by the words and phrases they share, so a word that appears in a hundred cheap queries, none of which looks worth a negative on its own, shows its full cost. Run the weekly review to keep the account clean and the n-gram analysis every month or quarter to find the patterns the review cannot see.

Should I add every wasteful n-gram as a negative keyword?

No. Read the full queries behind each one first, because the same word can be wasteful in one phrase and valuable in another. A single word added as a broad negative blocks every search that contains it, and Google documents that negatives do not match close variants, so the form you choose decides exactly what is blocked. Where a word is wanted in some phrases, add the wasteful phrases instead.

What period of search terms should I analyse?

Long enough for the account's volume to produce a meaningful number of conversions behind the main n-grams: a month can be enough in a busy account, while a quiet one may need a quarter or more. Avoid periods that include a major change to keywords, match types or bidding unless that change is what you want to read, and leave out the most recent days, whose conversions have not all arrived.

Terms used on this page

Tools to try

Also related

Sources

  1. About negative keywords — Google Ads Help
  2. About keyword matching options — Google Ads Help

Related