N-gram search query miner
Finds the words that waste money across thousands of small search terms, by adding up cost and conversions for every 1, 2 and 3-word phrase.
What it does
- Pulls every search term for the period, including Performance Max terms if you want them.
- Splits each term into 1, 2 and 3-word phrases and adds up impressions, clicks, cost, conversions and value for each.
- Writes a tab per phrase length to a Google Sheet, sorted by cost, with CPA, ROAS and conversion rate.
- Lists phrases that spent money with no conversions in a Wasted phrases tab.
- Emails you the most expensive wasteful phrases each week, ready to add as negatives.
How it changes your account
It does not change your account. It only reads search term data and writes to a Google Sheet in your Drive.
Smart Bidding
Useful with any bid strategy. Smart Bidding lowers bids on poor terms but still pays for them; negatives stop the spend completely. N-grams show you which words to block with confidence.
Settings explained
- Days of data
Longer periods surface patterns in low-volume accounts.
- Campaigns
Limit to one part of the account, or leave on all.
- Include Performance Max search terms
Adds Performance Max terms, which do not appear in the normal search terms report.
- Flag phrases that spent at least
The spend that makes a non-converting phrase worth your attention.
- Phrases in the email
How many to list in the weekly email.
Install in two minutes
- In Google Ads, go to Tools, then Bulk actions, then Scripts.
- Click the plus button and name your script.
- Delete the sample code, paste yours and click Authorise.
- Click Preview and check the log. Nothing changes in Preview.
- Click Save and set it to run weekly.
Preview once to authorise Sheets, Drive and email. Schedule it Weekly, for example Monday at 07:00.
Questions
What is an n-gram?
A run of n words inside a search term. "Cheap pizza near me" contains 1-grams like "cheap", 2-grams like "cheap pizza" and 3-grams like "pizza near me".
Why add up phrases instead of reading search terms?
Wasteful words are often spread across hundreds of terms that each cost a pound or two. Added up, the pattern is obvious.
Does it add negatives for me?
No, it reports only. Use the Non-converting search term alerts or Vertical intent blocker packs scripts to add negatives automatically.
Why do the totals look higher than my spend?
Phrases overlap: the cost of "cheap pizza" is also inside "cheap" and "pizza". Compare phrases of the same length.
Changelog
- 1.0.1 27 Nov 2026 Fix
- The log Sheet is only reused when it is a live Google Sheet, never a trashed file or another file with the same name.
- Long text is trimmed to fit a Google Sheets cell.
- First release in the Invincible Google Ads scripts library.
- 1.0.0 27 Nov 2026 Improvement
- First release in the Invincible Google Ads scripts library.
Scripts are provided as is. You're responsible for previewing, testing and monitoring them in your account. Scripts Terms of Use.