N-gram analysis breaks your search queries into recurring word and phrase building blocks, so patterns that eat budget across dozens of different queries finally show up in one row instead of hiding in hundreds. The verdict: run a 1 to 3 gram extract on your last quarter of search term data before you touch anything else. If a word like “cheap” or “free” appears repeatedly in queries with zero conversions, you may identify significant waste in a short time that manual query review might miss.
TL;DR:
- Running a 1 to 3 gram n-gram analysis on search query data reveals wasteful patterns, especially in low-converting queries containing words like “free” or “cheap.”
- Export data should include raw search terms, campaign details, match types, impressions, clicks, cost, conversions, and a 90-day (or seasonal) date range for accurate insights.
- Use spreadsheets for accounts with fewer than 5,000 search terms or scripts and Python pipelines for larger accounts to generate and interpret n-gram patterns efficiently.
- Focus on high-cost, zero-conversion n-grams with a waste share ratio over 85 percent to identify negative keyword candidates or opportunities for refined ad targeting.
- Always verify underlying queries before taking action on n-grams, and combine automation with manual review to avoid overblocking profitable queries or misreading data.
Table of Contents
- What Is N-Gram Analysis in Google Ads?
- What Data to Export for Ngram Analysis in Google Ads
- How to Run an N-Gram Script or Spreadsheet Pivot
- How Do You Interpret N-Gram Results?
- Turning N-Gram Findings Into Account Changes
- Common Mistakes That Undermine N-Gram Analysis
- Which Tools Handle N-Gram Analysis at Different Account Sizes?
- How Agencies Operationalize N-Gram Analysis at Scale
- What the Data Actually Supports Versus the Conventional Advice
- Get an N-Gram Audit Without Building the Script Yourself
- Sources
- FAQ
What Is N-Gram Analysis in Google Ads?
An n-gram is a chunk of consecutive words pulled from a search query. “Best running shoes for flat feet” breaks into unigrams (best, running, shoes, for, flat, feet), bigrams (best running, running shoes, shoes for, for flat, flat feet), and trigrams (best running shoes, running shoes for, shoes for flat). Each search term generates several overlapping n-grams, not just one.
That overlap is the entire point. Reviewing the Search Terms report line by line means eyeballing hundreds or thousands of unique queries, most of which appear only once or twice. N-gram analysis pools them by shared vocabulary, so a word that quietly appears in 60 different low-converting queries suddenly aggregates into one line with real statistical weight.
A quick example: if “installation,” “install,” and “installer” appear across 30 different search terms that together spent $400 with zero conversions, none of those 30 individual queries would flag as a problem on its own. As a bigram like “diy installation,” it becomes obvious.
- Unigrams catch broad, high-frequency words worth negating or bidding on
- Bigrams and trigrams catch intent phrases (“near me,” “how to,” “vs price”)
- Overlapping rows reveal patterns invisible in single-query review
What Data to Export for Ngram Analysis in Google Ads
Before running any script or pivot table, pull the right export. Get this wrong and every downstream calculation is noise.
- Search term — the raw query text, always in lowercase for consistent parsing.
- Campaign and ad group — segment by these so a script doesn’t blend a branded campaign with a cold-traffic prospecting campaign.
- Match type — broad match queries drift further from your keywords than phrase or exact, and they deserve separate scrutiny.
- Impressions, clicks, cost — the baseline volume and spend metrics every n-gram roll-up depends on.
- Conversions and conversion value — without these, you’re just counting words, not finding waste or winners.
- Date range — 90 days minimum for accounts with steady volume; a full year if you sell anything seasonal, so a single holiday spike doesn’t skew your averages.
Google’s own Search Terms report documents that low-volume queries can be omitted for privacy reasons, which is one more reason to use a wide enough date range that missing rows don’t distort your totals. If you’re pulling data manually rather than scripting it, the Keyword Planner and Search Terms report are the two canonical sources for the fields above.
Running a script instead of exporting by hand means writing your query in Google Ads Query Language (GAQL) rather than the older AWQL syntax. If you inherited a script written before 2023, check it against current GAQL syntax before you trust its output. Segment your export by campaign type too. Shopping and Performance Max search term insights behave differently than standard Search campaigns, and mixing them muddies your n-gram aggregates.
How to Run an N-Gram Script or Spreadsheet Pivot
Pick your method by account size. Spreadsheets work fine under roughly 5,000 search terms. Beyond that, a script or a Python pipeline handles volume and repetition far better.
Method 1: Spreadsheet pivot (small to mid accounts)
- Export your Search Terms report to Google Sheets or Excel with the columns listed above.
- Use a formula (SPLIT in Sheets, Text to Columns in Excel) to break each query into individual words.
- Build unigram, bigram, and trigram columns using array formulas or a helper script that generates sliding windows across the split words.
- Create a pivot table with the n-gram as rows and impressions, clicks, cost, conversions, and conversion value as summed values.
- Sort by cost descending, then eyeball the conversion column for anything sitting at zero with meaningful spend.
Method 2: Script or Python pipeline (larger accounts)
Paste a GAQL-compatible Google Ads script directly into the Scripts section of your account. Maintained versions of the Brainlabs Search Query Mining Tool have been updated for the current script environment and output campaign, ad group, and account-level tabs straight into a Google Sheet. Recommended starting parameters: minimum n of 1, maximum n of 3, a query character limit around 80, and an impression threshold of 10 or more to filter out single-appearance noise.
For accounts too large for the script editor’s runtime limits, a Python pipeline using pandas and NLTK handles the job outside Google’s execution window. The N-Grams Script v1.1 repository on GitHub is a working example that generates n-gram lists, computes performance metrics, and writes results to Excel.
Expect output tabs broken out by n-gram length (1, 2, 3 word) and by account level (account, campaign, ad group), each with columns for impressions, clicks, cost, conversions, conversion value, and calculated CTR, CPC, CPA, and ROAS.

Pro Tip: If your export times out or the sheet freezes, raise the minimum impression threshold in increments of 5 and rerun. Scripts that generate n-grams from tens of thousands of rows often need this kind of incremental filtering to stay inside compute limits.
Run this monthly for active accounts, weekly if you’re mid-restructure or launching new campaigns. Anything less frequent risks letting wasted spend compound for weeks before you catch it.
How Do You Interpret N-Gram Results?
Raw cost totals lie to you if you stop there. A high-cost n-gram with a healthy ROAS isn’t a problem. The same cost with zero conversions is.
Calculate four numbers for every n-gram above your impression threshold: CTR (clicks divided by impressions), CPC (cost divided by clicks), CPA (cost divided by conversions), and ROAS (conversion value divided by cost). Then layer on the diagnostic that actually prioritizes your cleanup list.
Diagnostic ratio: Share of cost without conversions equals the cost from nonconverting search terms containing that n-gram, divided by the n-gram’s total cost. An n-gram sitting at 85% or higher, with a decent query count behind it, is exactly what to inspect first for negative keywords.
For example, a bigram such as “free trial” might accumulate substantial total cost across many search terms, with a large proportion coming from queries that never converted, indicating a high share of cost without conversions. Compare it against “enterprise pricing,” which spent $310 across 12 queries with $280 in conversion value. One is a clear negative candidate. The other is a phrase worth protecting, maybe even expanding into its own ad group.
Before you touch either one, pull the actual search terms behind the n-gram. This step gets skipped constantly, and it’s how good keywords get accidentally blocked:
- Never act on an n-gram in isolation. Read the underlying queries.
- Watch for overlap. The same query’s cost counts in its unigram, bigram, and trigram rows, so summing n-gram rows will overstate total account spend.
- Set a minimum query count (5 to 10) before treating a high waste ratio as reliable rather than noise.
Turning N-Gram Findings Into Account Changes
Not every high-waste n-gram deserves the same fix. The decision tree is simpler than most advertisers make it.
If the word or phrase never has commercial intent for your business (think “jobs,” “salary,” “definition,” “free”), it’s a negative keyword candidate at the account or campaign level. If the phrase shows intent but underperforms in its current ad group, it’s a restructuring case, not a negative. Move it into a tighter ad group with matching ad copy instead of blocking it outright.
Roll out negatives in a staged way rather than mass-uploading:
- Label your candidate list by confidence (high, medium, needs review) before uploading anything.
- Add high-confidence negatives to a shared negative list first, so you can remove them account-wide if something breaks.
- Monitor impression share and conversion volume for seven to ten days post-upload before adding the next batch.
- Avoid single-word negatives unless the word has zero legitimate use case. “Free” might kill a converting query like “free consultation.”
N-grams work in the opposite direction too. A bigram converting well but absent from your keyword list, like “same day,” is a direct signal to add it as its own keyword with dedicated ad copy calling out that exact phrase. That’s often a faster path to incremental volume than broadening existing keywords.
Pro Tip: Run your candidate negative list past the Search Terms report one more time after 30 days. Search behavior shifts, and a word that was pure waste in Q1 sometimes turns commercial by Q3 as your market changes.
For a deeper framework on structuring the negative list itself, a complete guide to Google Ads negative keywords covers list hierarchy and shared sets in more depth than fits here.
Common Mistakes That Undermine N-Gram Analysis
The biggest failure mode isn’t running the analysis wrong. It’s acting on the output without enough skepticism.
Overblocking tops the list. Negating a single high-frequency word because it shows a bad ratio in aggregate, without checking whether a handful of its queries actually convert well, routinely kills profitable traffic alongside the waste. Mixing incompatible date ranges is the second most common error: combining a holiday sales period with a slow month produces averages that don’t represent either period honestly.
Ignoring the raw queries behind a statistic is the third trap, and it’s the one that turns a useful diagnostic into an expensive mistake. A bigram can look terrible in aggregate while containing three or four legitimately different search intents bundled together by shared words alone.
- Re-check any negative list 30 to 60 days after upload for lost impression share on adjacent, still-relevant terms
- Log every applied negative and its source n-gram in a shared document, so a future audit can trace why a term was blocked
- Rerun the full analysis monthly, or immediately after a significant offer, pricing, or landing page change
- Treat sampling gaps from Google’s privacy-based query omissions as a reason to widen your date range, not ignore the report
Which Tools Handle N-Gram Analysis at Different Account Sizes?
Four categories cover most advertisers, and the right pick depends almost entirely on volume and technical comfort.
Copy-paste Google Ads scripts are the fastest path for accounts already comfortable pasting JavaScript into the Scripts section. The maintained forks of the Search Query Mining Tool update the older AWQL syntax to current GAQL, which matters because scripts written before the migration will simply fail to run.
Python and pandas with NLTK suits teams with a developer on staff or an analyst comfortable in a notebook environment, and it scales past the runtime limits that choke browser-based scripts on very large accounts.
Spreadsheet pivots remain the right call for smaller accounts under a few thousand search terms, where the manual split-and-pivot approach in Google Sheets is faster to set up than debugging a script.
Before adopting any script or repository, check three things: does it use current GAQL syntax, was it updated recently enough to reflect Google’s script environment changes, and does it handle existing negative keyword lists without double-counting already-excluded terms. A script that fails any of these checks will produce numbers you can’t trust.
How Agencies Operationalize N-Gram Analysis at Scale
N-gram analysis is one input into a much larger audit process once an account crosses real spend thresholds. North Country Consulting manages over $40 million in Google Ads spend across client accounts, with an average return on ad spend of 8.7x, and n-gram review is a standard component of how that spend gets audited before restructuring begins.
A senior-led audit typically produces a candidate negative keyword list ranked by share of cost without conversions, ad group restructuring recommendations where n-gram patterns reveal mismatched intent, and conversion tracking fixes when the underlying data feeding the analysis turns out to be unreliable in the first place. That last point matters more than it sounds. An n-gram analysis built on broken attribution just produces confident-looking garbage.
This piece was written by Eric, drawing on operational patterns from managing high-spend accounts where manual query review simply doesn’t scale.
What the Data Actually Supports Versus the Conventional Advice
Most guides on this topic oversell the automation and undersell the judgment call at the end. Running a script is the easy part. Anyone can paste code into the Scripts section and get a spreadsheet back in ten minutes. The part that actually protects your account is reading the raw queries behind a high-waste n-gram before you negate it, and that step gets skipped constantly because it’s tedious and the script output looks so authoritative on its own.
The conventional advice treats n-gram output as a finished decision. It isn’t. It’s a prioritized list of things worth a human look. The overlap problem alone, where the same dollar of spend shows up in a unigram, bigram, and trigram row simultaneously, means treating any single row as gospel produces overblocking more often than it produces genuine savings.
If you take one thing from this: build the habit of checking query count alongside waste ratio, not waste ratio alone. The same ratio on 40 queries is a real signal worth acting on.
— Eric
Get an N-Gram Audit Without Building the Script Yourself
An alternative to running this analysis solo every month is to have a senior operator run the full diagnostic on your account and provide a ranked action list, avoiding the need to maintain a script or manage GAQL updates independently.

The free Google Ads audit covers exactly the ground this article walks through: n-gram waste identification, share of cost without conversions by candidate, and a check on whether your conversion tracking is even measuring the right thing before any negatives get applied. Every account gets senior oversight, not a junior analyst running a templated checklist, and account ownership stays with you the entire time.
If your account spends $25,000 or more a month, the audit maps directly into a full Google Ads management engagement covering campaign restructuring, attribution rebuilding, and ongoing optimization once the initial findings are in. Expect the audit itself to surface specific, numbered opportunities, not generic advice, within days of handing over account access. Request the audit and see what your last quarter of search terms is actually costing you.
Sources
Google’s own documentation on the Search Terms report is the primary source for how query data gets collected and what gets omitted for privacy. For script sources, the maintained Brainlabs-derived n-gram script and its GAQL-updated gist cover the copy-paste script route, while the Python n-gram repository covers the code-based pipeline. WordStream’s walkthrough is a solid step-by-step for first-time script users, and understanding how repeated language signals search intent helps translate n-gram patterns into better ad copy, not just cleaner negative lists.
- Brainlab’s Search Query Mining for N-gram Analysis (Updated) for new script environment
- N-Grams Script v1.1 (Python) on GitHub
- N-gram Analysis for Google Ads search terms
FAQ
What Does N-Gram Analysis Show in Google Ads?
It shows how impressions, clicks, cost, and conversions distribute across recurring word and phrase patterns in your search queries, surfacing waste and opportunity that single-query review misses because the same word repeats across dozens of unrelated queries.
Is $20 a Day Good for Google Ads?
A $20 daily budget works for very narrow, low-competition niches, but it rarely produces enough search term volume for meaningful n-gram analysis. You typically need at least a few hundred clicks a month before n-gram patterns become statistically reliable rather than noise.
How Much Does Google Ads Pay Per 1,000 Views?
Google Ads doesn’t pay advertisers for views. It’s an auction where advertisers pay per click or impression to show ads; the CPM model applies to Google’s display and video ad formats, not to running your own search campaigns.
What Is the Best Way to Monitor Search Term Waste Without Manual Review?
Maintained GAQL-compatible scripts, like updated forks of the Brainlabs Search Query Mining Tool, automate the aggregation, but pairing that automation with a senior-led audit like the one North Country Consulting runs catches issues a script alone will miss, including broken conversion tracking feeding bad data into the analysis.
How Often Should I Rerun N-Gram Analysis?
Monthly for stable accounts, weekly during active restructuring or after a significant pricing or offer change, and always after a 30 to 60 day check on any negative keywords you’ve already applied.
