Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function main() {
var costReport = AdWordsApp.report("Select Cost from ACCOUNT_PERFORMANCE_REPORT");
var reportRow = costReport.rows().next();
var totalCost = reportRow["Cost"].replace(',', '');
if (totalCost > 1000) {
var campaignIterator = AdWordsApp.campaigns().withCondition("Status = ENABLED").get();
while (campaignIterator.hasNext()) {
var campaign = campaignIterator.next();
campaign.pause();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.