/projects//google_ads/queries/ ).
1. Why Sentence-Level Query Reviews Fail at Scale
When an account generates 50,000 distinct search queries per month, human media buyers cannot manually inspect each row. Individual low-volume queries (1 or 2 clicks) appear harmless, but when aggregated by shared word stems, they reveal tens of thousands of dollars in wasted budget.
LIVE PLATFORM SCREEN & TELEMETRY
SEO Runway Google Ads Search Queries Explorer — Active Workspace
Below is the exact production screen with live parameters and dummy data illustrating the diagnostic findings and remediation buttons.
2. Executing N-Gram Reviews in SEO Runway
In SEO Runway → Google Ads → Search Queries, click the 'N-Gram Breakdown' tab. The tool groups queries into 1-gram, 2-gram, and 3-gram frequencies, highlighting cost-per-conversion anomalies for immediate negative keyword addition.
Target System: SEO Runway PPC Engine
Execution Frequency: Automated Background Queue (UTC Sync)
Tested across enterprise datasets with zero rate limiting or data loss.
3. What an N-Gram Analysis Actually Measures
An n-gram is a sequence of n words taken from a longer phrase. The search term "cheap adjustable dumbbells for home" contains the unigrams "cheap", "adjustable", "dumbbells", "for" and "home"; the bigrams "cheap adjustable", "adjustable dumbbells", "dumbbells for" and "for home"; and so on up to the full phrase. N-gram analysis breaks every search term in your report into these pieces, then adds up clicks, cost, conversions and conversion value for each piece across all the search terms that contain it.
The result shows patterns that row-by-row reviews miss. The word "free" may appear in 600 different search terms, each with one or two clicks and no conversions. Individually, none of them looks worth acting on. Together, "free" might represent $3,800 of spend with zero conversions, which makes it an obvious negative keyword candidate.
Choosing the right n
- Unigrams (1 word): best for finding single disqualifying words such as "free", "jobs", "diy", "used" or "repair".
- Bigrams (2 words): catch meaning that single words lose, such as "how to" for informational intent or "near me" for local intent.
- Trigrams (3 words): useful for product-level patterns, such as "power rack attachments" versus "power rack plans".
Analyse all three levels. Unigrams find the big leaks quickly; bigrams and trigrams refine them and stop you adding a negative that would also block profitable queries.
4. Getting the Data Out of Google Ads
Export the search terms report for a period long enough to be meaningful, usually 30 to 90 days depending on volume. Include search term, campaign, ad group, match type, impressions, clicks, cost, conversions and conversion value. You can download it from the interface, schedule it as a report, or pull it through the Google Ads API with the search_term_view resource.
Two details matter. First, Google hides some low-volume search terms for privacy reasons, so the report never covers 100% of spend; note the share of cost that is visible. Second, keep campaign and ad group columns so you can run the analysis separately for each campaign type. "Cheap" may be a waste word for a premium brand campaign and a profitable modifier for a clearance campaign.
5. Building the Analysis in Python
The analysis needs only pandas and a few lines of logic. The steps below describe the approach in plain terms; they translate directly into a short script.
- Load and clean. Read the exported CSV with pandas, keep the columns you need, convert cost and conversion columns to numbers (removing currency symbols and thousands separators), and lower-case every search term.
- Normalise text. Strip punctuation, collapse repeated spaces and optionally map plurals to a single form (for example, "dumbbells" and "dumbbell") so related terms group together.
- Generate n-grams. For each search term, split on spaces and build every sequence of one, two and three consecutive words. Use a set per term so a word repeated within one query is counted once for that query.
- Explode and aggregate. Create one row per term and n-gram pair, carrying that term's metrics, then group by n-gram and sum impressions, clicks, cost, conversions and value. Count the number of distinct search terms per n-gram as well.
- Calculate ratios. Add CTR, conversion rate, cost per conversion and ROAS for each n-gram, guarding against division by zero.
- Filter and sort. Remove stop words like "for", "the" and "in" from the unigram output, keep n-grams with enough cost to matter, and sort by cost with zero conversions first.
- Export. Write separate sheets for unigrams, bigrams and trigrams to an Excel file for review.
In pandas, the core of steps 3 and 4 is an apply that returns a list of n-grams, followed by explode and a groupby with sum. The whole script is typically under 60 lines and runs in seconds on hundreds of thousands of search terms.
Setting thresholds
Set a minimum cost or click threshold before you call an n-gram wasteful, based on your typical cost per conversion. A sensible rule is to flag n-grams with zero conversions whose cost exceeds 1.5 to 2 times your target CPA. Below that, the absence of conversions may be chance rather than evidence.
6. Reading the Output: Waste, Winners and Gaps
Review the sorted tables with three questions in mind.
- Waste: which n-grams spend meaningfully with no or very poor conversions? These are negative keyword candidates, such as "free", "pdf", "jobs", "diy", "rental" or a competitor's discontinued product line.
- Winners: which n-grams convert far better than average? Words like "commercial", "bulk" or a specific model number may deserve their own exact or phrase match keywords, dedicated ad groups and tailored ad copy.
- Gaps: which n-grams reveal demand you do not target directly? A trigram like "power rack with pulley" converting well inside a broad ad group suggests a product or landing page worth building out.
7. Turning N-Grams into Negative Keywords Safely
The biggest risk in n-gram work is over-blocking. Adding "cheap" as a broad match negative removes every query containing that word, including "cheap commercial squat rack" that may convert well in a value-focused campaign. Before adding any negative, check three things.
- Look at the underlying terms. Filter the original search terms for the n-gram and scan the list. Are there profitable queries hidden inside it?
- Choose the narrowest match type that works. Negative broad match blocks queries containing all the words in any order; negative phrase match blocks the exact sequence; negative exact match blocks only that exact query. Phrase match negatives are often the safest choice for bigrams and trigrams.
- Choose the right level. Apply universal waste words (such as "jobs" or "salary" for a retailer) to a shared negative list on every relevant campaign. Apply context-specific words at campaign or ad group level only.
Remember that negative keywords do not match close variants such as plurals and misspellings the way positive keywords do. If "repair" is a waste word, you may also need "repairs" and "repairing".
Using winners to restructure
Winning n-grams deserve the opposite treatment. Promote high-converting phrases into their own keywords with exact or phrase match, give them a tailored ad and landing page, and consider adding them as negatives in the broader ad groups so traffic routes to the dedicated ad group. This "query sculpting" sends each search to the most relevant ad, which improves both Quality Score and conversion rate.
8. Applying N-Grams to Performance Max and Broad Match
N-gram analysis is even more valuable in accounts using broad match and Performance Max, where the range of matched queries is much wider. For broad match campaigns, run the analysis weekly while campaigns are new, since early matching is often loose. For Performance Max, use the search terms insights and the search term data available in reporting, accepting that coverage is less complete than standard Search campaigns. Add confirmed waste themes to account-level negative keywords, which apply to Performance Max and Search, and use brand exclusions where needed.
9. Automating the Review
A script that runs once is useful; a script that runs every week is a system. Schedule the export through the Google Ads API, run the n-gram script automatically, and send the top waste and winner n-grams to a shared sheet or channel. Keep a record of every negative added, with the date and the n-gram evidence behind it, so you can revisit decisions if traffic patterns change.
Keep a human in the loop for the final decision. Automatically adding negatives based on thresholds can block valuable traffic when a new product launches or a term's meaning shifts. The script finds candidates; a person approves them.
10. Common Mistakes
- Using too short a window. Seven days of data rarely gives reliable n-gram totals outside very large accounts.
- Counting repeated words twice. A query like "rack for rack storage" should credit "rack" once, or totals become inflated.
- Ignoring conversion value. In e-commerce, an n-gram with few conversions but high order values may be profitable.
- Mixing campaign types. Brand, generic, Shopping and Performance Max queries behave differently. Analyse them separately.
- Forgetting hidden terms. If a large share of cost comes from hidden search terms, the n-gram tables describe only part of your spend.
11. N-Gram Review Checklist
- Export 30–90 days of search terms with full metrics, by campaign.
- Clean, normalise and generate unigrams, bigrams and trigrams.
- Aggregate metrics and calculate CTR, conversion rate, CPA and ROAS.
- Flag zero-conversion n-grams spending more than about 1.5 to 2 times target CPA.
- Check the underlying search terms before adding any negative.
- Add negatives at the narrowest suitable match type and level.
- Promote winning n-grams into dedicated keywords and ad groups.
- Schedule the analysis weekly and log every change.
12. A Worked Example from a Fitness Retailer
A fitness equipment retailer exported 90 days of search terms: 48,000 distinct queries with $210,000 in spend. Row-by-row review had found only a handful of obvious negatives. The unigram table told a different story.
- "diy" appeared in 1,140 queries, spending $6,300 with two conversions. Added as a broad match negative to the shared list.
- "used" appeared in 870 queries, spending $4,900 with no conversions. Added as a negative to new-equipment campaigns only, since a separate refurbished line could use it.
- "commercial" appeared in 2,300 queries with a conversion rate 2.6 times the account average and an average order value almost double. Promoted into a dedicated ad group with commercial-grade landing pages.
The bigram table added a refinement: "home gym" converted well, but "home gym ideas" did not. Rather than blocking "home" or "gym", the team added "gym ideas" as a phrase match negative. Two months later, cost per conversion on the generic campaigns had fallen noticeably, and the new commercial ad group was among the most profitable in the account.
Want the complete procedural runbook?
Visit our comprehensive step-by-step Knowledge Base for interactive screen maps, configuration parameters, and adjacent module workflows.
Open Knowledge Base Hub →

This is one of the clearest architectural explanations of this topic on the web. Sharing this directly with our senior delivery team. As a Agency Founder & Managing Director, this provides exactly the architectural depth we look for.