First Page Bid Script Issues

115 views
Skip to first unread message

Aron

unread,
Mar 19, 2015, 8:58:31 AM3/19/15
to adwords...@googlegroups.com
Hey all,

I've created a very simple script that I want to review all keywords and raise their bids to first page bids if they are below first page bids. The issue that I'm running into is that the script changes more than that - it changed a number of Low Quality Score bids also. I'm just concerned that there's something wrong with this script.

Can someone look it over and let me know?

function main() {
      var keywords=AdWordsApp
      .keywords()
      .withCondition("Status = ENABLED")
      .withCondition("AdGroupStatus = ENABLED")
      .forDateRange("LAST_7_DAYS")
      .get();
  
  while(keywords.hasNext())
  {
    var keyword=keywords.next();
    var bid=keyword.getMaxCpc();
    var firstPage=keyword.getFirstPageCpc();
        
    if(bid<firstPage && keyword.getCampaign().isEnabled()) {
      Logger.log("The bid for "+keyword.getText()+" will be raised from "+bid+" to "+firstPage);
      keyword.setMaxCpc(firstPage);
    }
  }

}

Alexander Wang

unread,
Mar 19, 2015, 8:46:36 PM3/19/15
to adwords...@googlegroups.com
Hi Aron,

If you don't want to update bids for keywords with low quality score, you should filter those out in the selector. Also, you can specify CampaignStatus in the selector rather than doing the filtering manually:
function main() {
     
var keywords=AdWordsApp
     
.keywords()
     
.withCondition("Status = ENABLED")
     
.withCondition("AdGroupStatus = ENABLED")

     
.withCondition("CampaignStatus = ENABLED")
     
.withCondition("QualityScore > 5")

     
.forDateRange("LAST_7_DAYS")
     
.get();
 
 
while(keywords.hasNext())
 
{
   
var keyword=keywords.next();
   
var bid=keyword.getMaxCpc();
   
var firstPage=keyword.getFirstPageCpc();

       
   
if(bid < firstPage) {

     
Logger.log("The bid for "+keyword.getText()+" will be raised from "+bid+" to "+firstPage);
      keyword
.setMaxCpc(firstPage);
   
}
 
}
}

Cheers,
Alex

Aron

unread,
Mar 22, 2015, 2:29:18 AM3/22/15
to adwords...@googlegroups.com
Awesome. Thx!
Reply all
Reply to author
Forward
0 new messages