Monday, November 19, 2012

Pause All Keywords With No Impressions

Let's start with a very simple script. This one will find all of the keywords in your account that has never had an impression, and pause (or delete if you see the comment below) that keyword so that it will not negatively impact your quality score. According to Google, the longer something sits in your account and stagnates, the greater the impact to your quality score. As a reader pointed out, the fourth bullet here seems to contradict this statement. This would be a great script to schedule every few months to make sure you are trimming all the dead weight from your accounts.

* Pause Keywords With No Impressions All Time
* Version 1.1
* Changelog v1.1
*   - Updated for speed and added comments 
* Created By: Russ Savage
var TO_NOTIFY = "";
function main() {
  // Let's start by getting all of the keywords with no impressions
  var kwIter = AdWordsApp.keywords()
    .withCondition("Impressions = 0") // could be "Clicks = 0" also
    .forDateRange("ALL_TIME") // could use a specific date range like "20130101","20131231"
    .withCondition("Status = ENABLED")
    .withCondition("CampaignStatus = ENABLED")
    .withCondition("AdGroupStatus = ENABLED")
  // It is much faster to store all the keywords you want to process
  // and then make the changes all at once. This takes advantage
  // of the batch processing behind the scenes.
  var toPause = [];
  while (kwIter.hasNext()) {
    var kw =;
    // This is to make sure you see things during the preview
    // When you run it for real, you can remove this clause to
    // increase speed.
    if(AdWordsApp.getExecutionInfo().isPreview() &&
       AdWordsApp.getExecutionInfo().getRemainingTime() < 10) {
  // Now go through each one and pause them.
  for(var i in toPause) {
    //Or you could use toPause[i].remove(); to delete the keyword altogether
  // Sent an email to notify you of the changes
                    "AdWords Script Paused "+toPause.length+" Keywords.", 
                    "Your AdWords Script paused "+toPause.length+" keywords.");


  1. Although I can see the logic in this script isn't the flaw that if I added a keyword yesterday then it may not get an impression immediately but could within 30 days. If I'm always adding keywords then how can I be sure I'm turning off "old" ones?

  2. That's true Robert, this script will have issues dealing with new keywords. I think you can fix it by using labels.

    For example, for new keywords, when you add them in adwords, give them a label of "NEW". Then, in the script above, add .withCondition("LabelNames CONTAINS_NONE ['NEW']") to the keyword selector logic.

    Now the issue is how to remove the "NEW" label after 30 days. I am currently working on a script that will manage labels so that you can tell how old an entity is. I will post a link here when i complete it. I have also added a feature request to the AdWords Scripts forum for accessing CreateDate which would make this much easier:


  3. This page contains the most interesting persuasive essay topics. Learn what is in the trend right now.

  4. I can only express a word of thanks. Because with the content on this blog I can add knowledge I, thank has been sharing this information. Do not forget to visit our website to share information hotele

  5. I don't really understand a thing about script writing. Thus, I am a professional writer at and it is not a problem for me to write an essay on any topic

  6. Great script. Even better with the labels

  7. You are in debt and want a way out! Contact us. Our financial experts will guide you with perfect Debt Settlement via the best Debt Settlement Companies.