Please how should I adjust this script, when I need to bid the position only for AdGroups, that have labels named ,,bid2":
var TARGET_AVERAGE_POSITION = 2;
var TOLERANCE = 0.1;
var BID_ADJUSTMENT_COEFFICIENT = 1.10;
function main() {
raiseKeywordBids();
lowerKeywordBids();
}
function raiseKeywordBids() {
var keywordsToRaise = getKeywordsToRaise();
while (keywordsToRaise.hasNext()) {
var keyword = keywordsToRaise.next();
keyword.bidding().setCpc(getIncreasedCpc(keyword.bidding().getCpc()));
}
}
function lowerKeywordBids() {
var keywordsToLower = getKeywordsToLower();
while (keywordsToLower.hasNext()) {
var keyword = keywordsToLower.next();
keyword.bidding().setCpc(getDecreasedCpc(keyword.bidding().getCpc()));
}
}
function getIncreasedCpc(cpc) {
return cpc * BID_ADJUSTMENT_COEFFICIENT;
}
function getDecreasedCpc(cpc) {
return cpc / BID_ADJUSTMENT_COEFFICIENT;
}
function getKeywordsToRaise() {
return AdWordsApp.adGroups()
.withCondition('Status = ENABLED')
.withCondition('AveragePosition > ' + (TARGET_AVERAGE_POSITION + TOLERANCE))
.orderBy('AveragePosition ASC')
.forDateRange('LAST_7_DAYS')
.get();
}
function getKeywordsToLower() {
return AdWordsApp.adGroups()
.withCondition('Ctr > 0.01')
.withCondition('AveragePosition < ' + (TARGET_AVERAGE_POSITION - TOLERANCE))
.withCondition('Status = ENABLED')
.orderBy('AveragePosition DESC')
.forDateRange('LAST_7_DAYS')
.get();
}