Showing posts with label maintenance. Show all posts
Showing posts with label maintenance. Show all posts

Monday, December 3, 2012

Automating Maintenance Tasks with AdWords Scripting Part 2

Let's continue with automating the maintenance tasks found in AdWords for Dummies with AdWords scripting. Let's continue with the maintenance that is run on the 15th of the month.


Reward keywords that are bringing in cheap traffic.


Similar to the previous post, you will need to have set up conversion tracking for all of this to work.  We can actually use a variation of the previous script to accomplish this.  Really we are doing the same thing just increasing bids instead of decreasing them.

//-----------------------------------
// Increase Bids Cheap Conversion Keywords
// Created By: Russ Savage
// FreeAdWordsScripts.com
//-----------------------------------
function main() {
  //For keywords with less than $5 CPC, let's pump those bids up by 35%
  var AMAZING_COST_PER_CONV = 5;
  var AMAZING_BID_INCREASE_AMOUNT = .35;
  
  //For keywords with between $5 and $8 CPCs, we will only increase the bids by 20%
  var GREAT_COST_PER_CONV = 8;
  var GREAT_BID_INCREASE_AMOUNT = .20;
  
  var kw_iter = AdWordsApp.keywords()
    .withCondition("Status = ENABLED")
    .get();
  
  while(kw_iter.hasNext()) {
    var kw = kw_iter.next();
    var kw_stats = kw.getStatsFor("LAST_30_DAYS");
    var cost = kw_stats.getCost();
    var conversions = kw_stats.getConversions();
    if(conversions > 0) {
      var cost_per_conversion = (cost/(conversions*1.0));
      
      if(cost_per_conversion <= AMAZING_COST_PER_CONV) {
        kw.setMaxCpc(kw.getMaxCpc() * (1+AMAZING_BID_INCREASE_AMOUNT)); 
      }
      else if(cost_per_conversion <= GREAT_COST_PER_CONV) {
        kw.setMaxCpc(kw.getMaxCpc() * (1+GREAT_BID_INCREASE_AMOUNT));
      }
    }else{
      //no conversions on this keyword
      //we will deal with that later
      continue;
    }
  }
}
Stay tuned for the next and final installment where we de-clutter our accounts by deleting the keywords with no conversions.

Thanks,
Russ

Thursday, November 29, 2012

Automating Maintenance Tasks With AdWords Scripting Part 1

I'm not ashamed.  I read "for Dummies" books.  And one of my favorites is AdWords for Dummies. Say what you want about these books, but they are easy to read and have great info for getting started quickly.

One of the chapters in the book describes a monthly routine for maintaining your AdWords account.  Using AdWords scripts is a good way to automate these tasks.  Let's start with the first of the month.

"On the first day of the month, deal with all the keywords that are converting too expensively."


Sounds simple enough.  Of course, you will need to have set up conversion tracking for all of this to work. They say pull the last 30 days, which is what we have done here, but you can pull any time range you like.  This follows the example from the book.  You should of course replace the values at the top with ones that make sense for your business.

//-----------------------------------
// Reduce Bids on High Cost per Conversion Keywords
// Created By: Russ Savage
// FreeAdWordsScripts.com
//-----------------------------------
function main() {
  //Let's reduce keywords with a CPC greater than $15 by 35%
  var WAY_TOO_HIGH_COST_PER_CONV = 15;
  var WAY_TOO_HIGH_BID_REDUCTION_AMOUNT = .35;
  
  //And keywords with CPC between $10 and $15 by 20%
  var TOO_HIGH_COST_PER_CONV = 10;
  var TOO_HIGH_BID_REDUCTION_AMOUNT = .20;
  
  var kw_iter = AdWordsApp.keywords()
    .withCondition("Status = ENABLED")
    .get();
  
  while(kw_iter.hasNext()) {
    var kw = kw_iter.next();
    var kw_stats = kw.getStatsFor("LAST_30_DAYS");
    var cost = kw_stats.getCost();
    var conversions = kw_stats.getConversions();
    if(conversions > 0) {
      var cost_per_conversion = (cost/(conversions*1.0));
      //Here is the magic.  If it is way too high, reduce it by the way too high amount
      if(cost_per_conversion >= WAY_TOO_HIGH_COST_PER_CONV) {
        kw.setMaxCpc(kw.getMaxCpc() * (1-WAY_TOO_HIGH_BID_REDUCTION_AMOUNT)); 
      }
      //otherwise, if it is still too high, reduce it with just the too high amount
      else if(cost_per_conversion >= TOO_HIGH_COST_PER_CONV) {
        kw.setMaxCpc(kw.getMaxCpc() * (1-TOO_HIGH_BID_REDUCTION_AMOUNT));
      }
    }else{
      //no conversions on this keyword
      //we will deal with that later
      continue;
    }
  }
}
And that's it. Stay tuned for the next installment where we tackle the keywords that are performing well by increasing their bids.

Thanks,
Russ