An AdWords Script To Make Exact Match, Well…Exact
Sorry Google, we've written a script to reverse your "close variant matching."
Many of you will have heard about Google’s decision to terminate exact match (at the same time as telling us that it’s for our own good). It’s a clear move to grab some more advertising dollars, and the news has been met with fury by SEM experts.
Most two-year-old kids know that there is a semantic difference between singular and plural forms — and anyone with the slightest command of the English language will know that there is a difference between [photographer] and [photography]. While a professional photographer might want to spend money on [photographer], they probably wouldn’t want to appear for [photography] as this is more likely to be a search for photos that users can download.
Instead of signing the petition on change.org asking Google to reverse this change, we’ve just written a script to automatically make exact match, well…exact.
The AdWords script runs search term reports and adds “close variant” terms as exact negatives if they are not the exact original keyword.
You can run this script at MCC level for all your accounts, or choose individual accounts, campaigns or ad groups. Just copy the code below, log in to AdWords, go to Bulk Operations (left-hand column) > Scripts > New. Paste the code into the box and click Preview to see the changes that the script will make if you run it. Set up a schedule to run this script daily and your keyword matching will behave similarly to how it did before. If you’ve never run a script before you can read our Introduction to AdWords Scripts.
Two caveats: we’ve seen a lot of search terms appear under “Other search terms” in Search Query Reports. These cannot be excluded as Google does not tell us what they are. Secondly, search term report data does not appear on the same day, so we’ll always be a day behind Google’s close variants.
How The Script Works
For those brave enough, we’ll now break the script down into more detail.
Choosing Your Settings
We’ve made the script flexible so that it works for different account structures. For example, you can decide whether to add your negative exact keywords at campaign or ad group level. We’ve built in functionality to exclude certain campaigns or adgroups as the script runs.
We start by pulling a search query report for the last seven days (or any other time period you wish). We store all this information in arrays, with an array for the ad group ids, campaign ids, keyword ids, search queries, keywords, and match types. It’s important to note that all the data associated with a search query is located in the same position in each of the arrays.
The Important Part
Next is the crucial step: the if statement below takes all the search terms that do not exactly match the keyword they triggered AND have keyword match type exact (close variant). This gives us exactly what we’re after: all those pesky new search terms that have been created as a result of Google’s change.
We store all these search queries with the campaign id, ad group id and keyword id that they are associated with.
Finally Adding The Negatives
All that is left to do now is to add campaign (or ad group) negatives to the relevant campaigns (or ad groups). It looks complicated, but it’s actually quite straightforward.
We first take all the campaigns that we need to add negatives to, together with their id and name. Iterating through each campaign, we next create all the negative keywords associated with this campaign by matching up ids. And finally all that is left to do is to add these negative keywords to the correct campaign.
Checking The New Negative Keywords
For our final act, we log all the changes we’ve made to check that we’re happy with the new negative exact keywords.
And then we’re done. Sorry, Google!
Opinions expressed in this article are those of the guest author and not necessarily Search Engine Land. Staff authors are listed here.