How N-gram Keyword Script Analysis Can Skyrocket Your Google Ads Results

What on earth is an N-gram analysis?

In the context of Google Ads, it's a technique that helps us study 
how different combinations of words in our search queries perform.

Say you're running a campaign for a shoe store. Through a type of N-gram analysis known as 'bigram analysis,' you might discover that search terms like "blue shoes" are netting you many conversions, whereas "red shoes" are lagging.

Why does this matter?

Because armed with this knowledge, you can fine-tune your campaign to 
focus on what works and weed out what doesn't. For instance, if certain words like 'near' or 'price' never seem to convert, it might be worth excluding them to save your budget.

If you're just looking for the script, it's at the end of this article, but I recommend reading everything.

Visual Walkthrough

Before we delve into practical use cases, let's get hands-on and see how an N-gram analysis works:

  1. First, gather the keywords you want to analyze. For instance, here are the "blue shoes" keywords from Semrush:

    n-gram_keyword_analysis_1

  2. Next, copy-paste these keywords into an N-gram analyzer. You can find these analyzers by simply typing 'Ngram data analyzer' into Google:

    n-gram_keyword_analysis_2

  3. Choose the frequency. A 'unigram' frequency will analyze individual words and their frequency in your chosen keywords:

    n-gram_keyword_analysis

  4. For 'bigram' frequency, it'll look something like this:


    n-gram_keyword_analysis

  5. For 'trigrams':

    n-gram_keyword_analysis

How The Script Report Looks Like

You may need more time to manually copy all your search terms from your account and analyze them online.

Fortunately, that's what the script is for. With it, we analyze the frequency of your search terms and extract essential data such as conversions, conv. value/cost (ROAS), clicks, impressions, CTR, and cost.

Here's how the final report looks like (phrases hidden for privacy reasons):

n-gram_analysis_google_ads_script_1

Simplified Step-By-Step Process

Here's a quick guide on how you can run an N-gram analysis using a Google Ads script:
  1. Choose What to Analyze: Decide on the scope - whether you want to analyze search terms in a specific campaign, a specific campaign type (search or shopping), or go account-wide.

  2. Choose Your Date Range: Pick a time frame that is long enough to provide a significant amount of data but not so long that it includes out-of-date information.

  3. Run Your Script: Go to Google Ads and run your script. It will generate your N-gram analysis and output it into a Google Sheet.

  4. Analyze Your Data: Evaluate the performance of different N-grams in your data. Sort by conversions to see which N-grams convert the most or by cost to see where you spend the most.

  5. Take Action Based on Your Findings: Use your analysis to inform your campaign decisions. Consider adding negative keywords for N-grams that spend a lot without converting or bid more aggressively on N-grams that convert well.

Some Use Cases For Google Ads

Let's explore some strategies to leverage this script for enhancing your Google Ads performance:

Excluding Non-converters Account-Wide

If you notice words that never led to a conversion, it's worth considering excluding them account-wide. This can also apply to keywords with a ROAS (Return on Ad Spend) or CPA (Cost Per Acquisition) that falls below your profitability threshold. An account-wide, unigram (1-gram) analysis can help identify these terms.

Boosting Conversion Rates of Certain Words

Reviewing the unigram analysis, you might identify words leading to conversions but still underperforming based on your CPA or ROAS goals.

I don't advocate for excluding searches/campaigns/ad groups that convert but aren't profitable. Instead, it's better to look for improvements - consider modifying the ad text, adjusting the landing page, lowering bids, or excluding specific search terms. The aim should be to optimize conversion efficiency rather than removing potentially valuable keywords altogether.

Here's a tip: run a bigram (2-gram) analysis and filter the results for the underperforming word. This will help you identify which word combinations you could exclude to improve performance.

You can also inspect this word's performance in your account by following these steps: 'All campaigns' view -> Search term report -> Filter by 'Search term contains '[your word]' -> Check specific search terms that may be negatively affecting ROAS or increasing CPA.

Correcting Mistakes in Negative Keyword Lists:

The N-gram script can be a lifesaver if you've recently taken over an account or mistakenly excluded some keywords. Run the script and review whether the excluded keywords were, in fact, converting in the past. If so, removing them from exclusions could unlock more converting traffic.

Spotting High-Performance Phrases:

Breaking down your keywords and search terms into smaller components allows you to identify specific overperforming words or phrases. This could be crucial for optimizing your bidding strategies - you should increase your bids on keywords that include these high-performing phrases.

Brainlab's N-gram Script 

You can get a copy of the script from here - N-gram Script.

Here are a few things to keep in mind before running the script:

1. Script Timeout: Be aware that the script might time out if set to analyze data spanning years or months, particularly if your account has large amounts of data.

2. Separate Reports for Different Campaign Types: Consider generating separate reports if you manage search and shopping campaigns. This is due to the typically lower conversion rates for generic search than shopping search. Analyzing both types together may give you a skewed perspective of your keywords' performance. Certain words may prove profitable in shopping campaigns but not in search.

3. Excluding Non-converting Words with Low Spend: Be cautious about excluding words that haven't converted yet but also haven't accumulated significant spending. It's generally better to wait until you have more data before deciding to exclude. For instance, you might set a threshold, such as excluding a phrase only when it exceeds your acceptable CPA or falls short of your ROAS target.

Wrapping Up

When utilized effectively, N-gram analysis can be a powerful tool for refining your Google Ads campaigns. It can provide valuable insights into your keyword performance and help you identify patterns that might go unnoticed.

Whether it's pinpointing high-performing phrases to bid more aggressively on, identifying non-converting words to exclude, or fixing errors in your negative keyword lists, the potential is there. However, as with all powerful tools, it's crucial to use them wisely and not to make hasty decisions based on limited data.

Remember to take advantage of the N-gram script and leverage its potential to help you optimize your campaigns effectively.

With careful analysis, informed decisions, and continual optimization, you can harness the power of N-gram analysis to improve results in your Google Ads campaigns. And as always, should you need further advice or assistance, don't hesitate to reach out.

And remember - always strive to improve your Google Ads game, even just a little bit, each and every day.

June 11, 2023 — Peter Kurzedlak

Leave a comment

Please note: comments must be approved before they are published.