function main() {
var accountIterator = MccApp.accounts().get();
while (accountIterator.hasNext()) {
var account = accountIterator.next();
MccApp.select(account);
var accountStats = account.getStatsFor("INSERT_DATE_RANGE");
var keywordsIterator = AdWordsApp.keywords().get();
while (keywordsIterator.hasNext()) {
var keyword = keywordsIterator.next();
var keywordStats = keyword.getStatsFor("INSERT_DATE_RANGE");
//If account CTR =<2%
if (accountStats.getCtr() <= 2) {
//keyword CTR =<2%
if (keywordStats.getCtr() <= 2) {
//Pause keyword
keyword.pause();
}
//If account CTR =>2.1%
} else {
//keyword CTR =<2% or with no CTR
if (keywordStats.getCtr() <= 2) {
//Enable keyword
keyword.enable();
}
}
}
}
}function main() {
var accountStats = AdWordsApp.currentAccount().getStatsFor("INSERT_DATE_RANGE");
var keywordsIterator = AdWordsApp.keywords().get();
while (keywordsIterator.hasNext()) {
var keyword = keywordsIterator.next();
var keywordStats = keyword.getStatsFor("INSERT_DATE_RANGE");
//If account CTR =<2%
if (accountStats.getCtr() <= 2) {
//keyword CTR =<2%
if (keywordStats.getCtr() <= 2) {
//Pause keyword
keyword.pause();
}
//If account CTR =>2.1%
} else {
//keyword CTR =<2% or with no CTR
if (keywordStats.getCtr() <= 2) {
//Enable keyword
keyword.enable();
}
}
}
}