Created
March 16, 2019 11:05
-
-
Save g-ads-org/8369eea5123bea776489a99080b73aaf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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