Monday 15 May 2017

Script for Automation Optimisation of Avg. Position

First Go to Bulk Operations




Click on the Bulk Operations 

Now Choose the Script 






Now click on the Red Button


When will you add Script . First you click on the Authorize Now








You can choose Target Average Position. Which postion you want to show your ads. 


Tolerance means if our ads position will be low at 0.1 then our script will be work on it.


Bid Adjustment Cofficient mean our bid will be increase only 1.05% not more than it 




// Ad position you are trying to achieve.
var TARGET_AVERAGE_POSITION = 3;
// Once the keywords fall within TOLERANCE of TARGET_AVERAGE_POSITION,
// their bids will no longer be adjusted.
var TOLERANCE = 0.1;
// How much to adjust the bids.
var BID_ADJUSTMENT_COEFFICIENT = 1.05;
function main() {
  raiseKeywordBids();
  lowerKeywordBids();
}
function raiseKeywordBids() {
  // Condition to raise bid: Average position is greater (worse) than
  // target + tolerance
  var keywordsToRaise = AdWordsApp.keywords()
    .withCondition('Status = ENABLED')
    .withCondition('AveragePosition > ' + (TARGET_AVERAGE_POSITION + TOLERANCE))
    .orderBy('AveragePosition ASC')
    .forDateRange('LAST_7_DAYS')
    .get();

  while (keywordsToRaise.hasNext()) {
    var keyword = keywordsToRaise.next();
    keyword.setMaxCpc(keyword.getMaxCpc() * BID_ADJUSTMENT_COEFFICIENT);
  }
}
function lowerKeywordBids() {
  // Conditions to lower bid: Ctr greater than 1% AND
  // average position better (less) than target - tolerance
  var keywordsToLower = AdWordsApp.keywords()
    .withCondition('Ctr > 0.01')
    .withCondition('AveragePosition < ' + (TARGET_AVERAGE_POSITION - TOLERANCE))
    .withCondition('Status = ENABLED')
    .orderBy('AveragePosition DESC')
    .forDateRange('LAST_7_DAYS')
    .get();


  while (keywordsToLower.hasNext()) {
    var keyword = keywordsToLower.next();
    keyword.setMaxCpc(keyword.getMaxCpc() / BID_ADJUSTMENT_COEFFICIENT);
  }
}



Now add  script and Preview it 


If no errors found then run it for experiments 


We can Create a Schedule of this Script. At which time we want to run this script







Please Try it and Share your Feedback With Us. 

Good Luck



No comments:

Post a Comment