In semantic text analysis, n-gram analysis is one of the key methods. It reveals all unique words and word combinations in a text and counts how often each occurs. Frequency of n-grams is the simplest way to find keywords — words and phrases that appear noticeably more often than the rest.
What an n-gram is
An n-gram is a sequence of n words that go one after another. In the search term “buy running shoes online” there are four 1-grams (single words), three 2-grams (“buy running”, “running shoes”, “shoes online”), two 3-grams and one 4-gram. When thousands of search terms are split this way and the statistics of every n-gram are summed up, you see which words and combinations bring clicks and conversions and which only spend budget.
How n-gram analysis helps in PPC
In search advertising (Google Ads, Microsoft Advertising) n-gram analysis is useful for at least three tasks.
Preventing cannibalization between regular and DSA campaigns
Dynamic Search Ads often pick up the same queries as your keyword campaigns. Excluding cannibalizing queries one by one doesn’t work: there are too many of them, and new ones keep appearing. Instead, run n-gram analysis on the search terms of both campaign types and exclude the overlapping n-grams from one of them as negative keywords. A single n-gram covers a much bigger pool of queries than any individual query.
Understanding user preferences and intents
The words people add to the core query — “cheap”, “for kids”, “near me”, “waterproof”, a brand or a color — show what they actually want. Grouping search terms by such n-grams with their clicks and conversions gives recommendations for ad copy, landing pages and even the product range.
Finding ineffective words and combinations
Sometimes a word performs at an average level on its own but is ineffective in a certain combination, and vice versa. For example, “shoes” converts well, “free” doesn’t matter much, but “free shoes” brings only clicks from people looking for giveaways. N-gram analysis at the level of 2- and 3-grams reveals such collisions, which are invisible when you look at single words or whole queries.
How to run n-gram analysis of search terms in Excel
All you need is a search terms report exported from your ad account and the !SEMTools add-in:
- Export the search terms report with impressions, clicks, cost and conversions to Excel.
- Select the column with search terms together with the metric columns to the right of it.
- On the !SEMTools tab, open Web (Scraping, SEO, PPC) → Semantic analysis → Frequency dictionary → N-gram analysis and choose Words (1-gram), 2-grams, 3-grams or N-grams (custom).
- The add-in writes the n-grams to a new sheet and sums every metric for each of them. Add CTR, CPC, CPA and conversion rate as simple formulas and sort the table.
Dashes and empty cells in metric columns are treated as zeros. To combine different word forms (“shoe” and “shoes”), use the N-gram lemms menu. Details and examples of every mode are in the article on n-gram analysis in Excel.
| 2-gram | Clicks | Cost | Conversions | CPA |
|---|---|---|---|---|
| running shoes | 1,240 | $1,860 | 62 | $30 |
| shoes free | 310 | $405 | 0 | — |
| waterproof shoes | 185 | $290 | 14 | $20.7 |
In this example, “shoes free” is an obvious negative keyword candidate, and “waterproof shoes” deserves its own ad group with a dedicated ad and higher bid.
Run n-gram analysis of thousands of search terms with impressions, clicks, cost and conversions right in Excel — and find negative keywords and growth points in minutes.
!SEMTools solves this and hundreds of other tasks in a couple of clicks!
Summary
N-gram analysis turns a long, noisy search terms report into a short list of words and combinations with clear performance. Use it to separate regular and DSA campaigns, to understand user intents and to find ineffective combinations that hide behind average-looking words.