• About Us
  • Contributors
  • Guides
  • Speaking Engagements
  • Write for The SEM Post
  • Submit a tip or contact us!
  • Newsletters

The SEM Post

Latest News About SEO, SEM, PPC & Search Engines

  • Google
  • SEO
  • Mobile
  • Local
  • Bing
  • Pay Per Click
  • Facebook
  • Twitter
  • State of the Industry
You are here: Home / Google / Near Exact Match Monitoring AdWords Script

Near Exact Match Monitoring AdWords Script

August 15, 2014 at 1:24 pm PST By Steve Hammer

  • Facebook
  • Twitter
  • Google+
  • Pinterest
  • LinkedIn
  • Email
  • WhatsApp
  • Evernote
  • SMS

Google’s recent tyrannical announcement to force AdWords advertisers to accept close variants with exact and phrase match has caused many sophisticated advertisers quite a bit of heartburn.  For one, I’m concerned that with large and detailed accounts the loss of control can result in a major reduction in efficiency.   It’s great (for Google) that the account might generate more clicks, but it’s not necessarily going to have the same intent or sophistication (read: conversion rate) as the traffic my clients intended to bid on.  Conversions pay the bills and any loss in that rate can hurt.

After all this is a close variant:

ImAwsome

Close enough is good enough for Google right?

It didn’t help my mood when I read the announcement blog post and noticed that all three cases talked about cheaper clicks and/or higher volume.  Zero mentions of improved advertiser ROI or conversion rate.

Oh Bother

After calming myself down with some orange slices, I remembered that data settles arguments among rationalists.    At the very least we can take a look at how often close variant is triggered in our accounts.

All we have to do is check a single exact match keyword, then run a search query report on it and look at the data.  The data tells the story.

But what if we have hundreds or thousands of exact match keywords?

We could spend weeks pulling the data, which is obviously not an option.

We could use some fancy excel trickery on a campaign export.

Or we could write an AdWords script to do a lot of that for us.  Thanks in particular to my business partner Nathan who is far better than I am at structured queries.  (and programming in general as well)

The script works by using an AdWords Query to pull the data that we care about.  Once the data’s been pulled, we manipulate it a bit to output to a Google document.  Unfortunately “group by” isn’t part of the AdWords query language, so we’re ordering instead.  The output is pushed together in places the keyword matches.  It does include terms that get exact match searches even if they aren’t set to broad match.  It does not include matches that have gotten zero impressions.

To use the script, create a blank Google doc spreadsheet and paste the link to it in the first variable between the single quotes.  It’s best if the doc is named, and the url should include the /edit at the end.

Feel free to add any other metrics to the “columns” part as well.  It can also be expanded to include phrase and near_phrase match types by changing the match type variable.  Yes it does expect all caps, and yes they actually do call it “near exact”

We’re working on a revision that will include a bit more math and excludes non-exact match types that did “hit” an exact match.

Also a warning.  There’s a limit on the number of results that are returned.  Particularly large accounts can add additional “where” clauses to output the results by specific campaigns.

/************************************************
* Exact Match Monitor
* Version 1.0
* Created By: Nathan Byloff
* www.rankhammer.com
************************************************/

function main() {

  var SPREADSHEET_URL = '';  
  var DATE_RANGE = 'LAST_7_DAYS';
  var MATCH_TYPE = '[EXACT, NEAR_EXACT]';
  
  var columns = ['CampaignName',
                 'AdGroupName',
                 'KeywordTextMatchingQuery',
                 'MatchType',
                 'Query',
                 'Impressions',
                 'Clicks',
                 'Cost',
                 'Conversions'];
  var columnsStr = columns.join(',') + " ";
  
  var reportIter = AdWordsApp.report(
    'SELECT ' + columnsStr +
    'FROM SEARCH_QUERY_PERFORMANCE_REPORT ' +
    'WHERE MatchTypeWithVariant IN ' + MATCH_TYPE + 
    ' DURING ' + DATE_RANGE, {
      includeZeroImpressions: false
    }).rows();
    
  var data = {};
  while(reportIter.hasNext()) {
    var row = reportIter.next();
    
    if ( !data.hasOwnProperty( row['KeywordTextMatchingQuery'] ) ) {
        data[ row['KeywordTextMatchingQuery'] ] = [];
    }
    data[row['KeywordTextMatchingQuery']].push(row);
  }
  
  var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
  var firstSheet = spreadsheet.getSheets()[0];

  var rowCnt = 1;
  var colCnt = 1;
  for(row in data) {
    for(i in data[row]) {
      var newRow = data[row][i];
      if (rowCnt == 1) {
        firstSheet.getRange(rowCnt, 1, 1, columns.length).setValues([columns]);
        rowCnt++;
      }
      colCnt = 1;
      for(col in columns) {
        firstSheet.getRange(rowCnt, colCnt, 1, 1).setValue(newRow[columns[col]]);
        colCnt++;
      }
      rowCnt++;
    }
  }
}

Also available on github here

Feel free to share your experiences with the script as well as improvements we could make to it.  We might not be able to change minds by rabble-rousing, but data might tell a more compelling story.

  • Facebook
  • Twitter
  • Google+
  • Pinterest
  • LinkedIn
  • Email
  • WhatsApp
  • Evernote
  • SMS
The following two tabs change content below.
  • Bio
  • Latest Posts
My Twitter profileMy Google+ profile

Steve Hammer

President & Co-Founder at Rank Hammer
Steve Hammer is President and co-founder of RankHammer, a full service search marketing agency in Dallas, Texas. Steve's experience in online media and traditional marketing allows a strategic and long-term view of search marketing. He has achieved extraordinary and sustainable results in several competitive online industries often exceeding growth rates in excess of 50% per year. Prior to RankHammer, Steve held a number of exemplary positions including Director of Search Marketing for ACE Cash Express, General Manager for Stir, and a practicing Chemical Engineer for BASF. He holds a MBA from the prestigious Kellogg School of Management. Steve is very active in the Dallas and Search Marketing community, as a former VP on the DFWSEM. He has spoken at numerous meetings and conferences including SES, ClickZLive, SMX Advanced, State of Search, Pubcon, and Interactive Insights Summit.
My Twitter profileMy Google+ profile

Latest posts by Steve Hammer (see all)

  • Overcoming AdWords Conversion Data Discrepancies - February 12, 2015
  • Near Exact Match Monitoring AdWords Script - August 15, 2014
  • Why the Advanced AdWords Certification Exam Made Me Write An AdWords Happy Hour Script - August 4, 2014

Filed Under: Google, Pay Per Click Tagged With: AdWords scripts, Google AdWords, keyword matching

Sign up for our newsletter


Trackbacks

  1. All Exact & Phrase Match Keywords Turning Into Close Variant Keyword Matching - The SEM Post says:
    August 16, 2014 at 12:37 pm

    […] The SEM Columnist Steve Hammer has created a Near Exact Match Monitoring AdWords script that makes it easy for advertisers to deal with the […]

Founder & Editor

Jennifer Slegg (2052)

Sign up for our daily news recap & weekly newsletter.


Follow us online

  • Facebook
  • Google+
  • Linkedin
  • Pinterest
  • Twitter

Latest News

2022 Update for Google Quality Rater Guidelines – Big YMYL Updates

We finally have the first Google Quality Rater Guidelines update of 2022, and like usual, it is … [Read More...]

Recent Posts

  • 2022 Update for Google Quality Rater Guidelines – Big YMYL Updates
  • Google Quality Rater Guidelines: The Low Quality 2021 Update
  • Rethinking Affiliate Sites With Google’s Product Review Update
  • New Google Quality Rater Guidelines, Update Adds Emphasis on Needs Met
  • Google Updates Experiment Statistics for Quality Raters
  • Analyzing “How Google Search Works” Changes from Google
  • Google Quality Rater Guidelines Update: New Introduction, Rater Bias & Political Affiliations
  • Google Updates Quality Rater Guidelines: Reputation for News Sites; Video Content Updates; Quality for Information Sites
  • Google Makes Major Changes to NoFollow, Adds Sponsored & UGC Tags
  • Google Updates Quality Rater Guidelines Targeting E-A-T, Page Quality & Interstitials

Categories

  • Affiliate Marketing
  • Amazon
  • Apple
  • Bing
  • Branding
  • Browsers
  • Chrome
  • Content Marketing
  • Design
  • Domains
  • DuckDuckGo
  • Email
  • Facebook
  • Firefox
  • Foursquare
  • Google
    • Analytics
    • Google RankBrain
    • Quality Rater's Guidelines
  • History of Search
  • Industry Spotlight
  • Instagram
  • Internet Explorer
  • Links
  • Local
  • Mobile
  • Native Advertising
  • Other Search Engines
  • Pay Per Click
  • Pinterest
  • Publishers
  • Security
  • SEO
  • Snapchat
  • Social Media
  • State of the Industry
  • The SEM Post
  • Tools
  • Twitter
  • Uncategorized
  • User Experience
  • Video Marketing
  • Week in Review
  • Whitepapers
  • Wordpress
  • Yahoo
  • Yelp
  • YouTube
December 2025
MTWTFSS
« Aug  
1234567
891011121314
15161718192021
22232425262728
293031 

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Copyright © 2025 · News Pro Theme On Genesis Framework · WordPress · Log in