Back in 2015, the guys at Brainlabs created a very popular script that allows you to analyze n-grams in your search term data.
An n-gram is a phrase made of n words: a 1-gram is a single word, a 2-gram is a phrase made of two words, and so on. For example, “this four word phrase” contains three 2-grams (“this four,” “four word,” “word phrase”) and two 3-grams (“this four-word” and “four word phrase”).
The script adds up the clicks, impressions, cost, converted clicks and conversion value of each query containing the n-grams — and calculates the click-through rate, cost per click, conversion rate, CPA and value/cost — so you can see their impact.
If the performance is good, you might want to make new ad groups around the n-gram; if the performance is bad, you might want to exclude the n-gram as a negative phrase-match keyword.
If you’re using the Google Ads n-gram script (aka ‘Search Query Mining Tool’) you may have noticed it’s not working in the new Google Ads scripts experience.
It throws an error like:
InputError: shared_criterion.keyword.text || shared_criterion.placement.url || etc.
The issue is caused by an AWQL query that is not compatible with the new script environment.
To fix the issue I’ve updated the script so that it now uses GAQL to retrieve the data.
For instructions on how to use the script, please visit the original post at SearchEngineLand .
Here’s the updated code: