Spell-check your new expanded text ads with this AdWords script

Well, it looks like we’re all going to be writing a lot of new ad copy. The recent release of expanded text ads provides us with 45 additional characters for our AdWords ads, which we can use to give searchers more context to make decisions. But it also provides us with an opportunity for making mistakes.

I always try to leverage AdWords scripts as a way to minimize mistakes, or to catch those mistakes as quickly as possible. With that in mind, I figured I’d share a spell-checking script for verifying that any active ad you write has everything spelled correctly.

For this script, I am leveraging the Bing Spell Check API. Yes, that’s right — I’m using Google to call a Bing API. It just so happens Bing has a pretty awesome API that lets you build the power of Microsoft Word’s spell-check into any application, and all you need to do is register to get a key.

The free account only gives you 5,000 API calls a month, so I tried to design the script to leverage caching as much as possible. It will cache the previous call, as well as a list of misspelled words that it stores on your Google Drive. If any of these words show up in your ad, it will send that data back immediately without calling the API.

I’d like to share a quick MCC-level script for checking ad copy as well. I leverage something like this script sort of like a guardian angel. It is always running in the background of my MCC, checking for ads that have issues. When it finds one, it will mark it with a label, which lets me know I need to make some changes. If you wanted to be more robust, you could configure this to send you an email (or a Slack message) whenever it finds an issue.

It’s very possible that this script will run out of time or quota from the Bing API before completing successfully. This is fine, as the number of ads it operates on will continue to shrink over time. Eventually, all your ads will have a green label indicating they have been checked, and any new ads will automatically be checked as they are added.

varCHECKED_LABEL_NAME=“Spellchecked“;

varISSUE_LABEL_NAME=“Spelling Issue“;

functionmain() {

var bing =newBingSpellChecker({

key :‘xxxxxxxxxxxxxxxxxxx‘,

toIgnore : [‘adwords‘,‘adgroup‘,‘russ‘],

enableCache :true

});

var accountIter =MccApp.accounts().get();

while(accountIter.hasNext()) {

MccApp.select(accountIter.next());

checkAds(bing);

if(bing.hitQuota) {

break;

}

}

bing.saveCache();

}

functioncheckAds(bing) {

createLabelIfNeeded(CHECKED_LABEL_NAME,‘Indicates an entity was spell checked‘,‘#00ff00‘/*green*/);

createLabelIfNeeded(ISSUE_LABEL_NAME,‘Indicates an entity has a spelling issue‘,‘#ff0000‘/*red*/);