Skip to content

Instantly share code, notes, and snippets.

@g-ads-org
Created March 16, 2019 11:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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