Skip to content

Instantly share code, notes, and snippets.

@adhummer
Forked from daniel-c05/minimize-over-delivery.js
Last active August 29, 2015 14:14
Show Gist options
  • Save adhummer/750327518a2ef0c7cf42 to your computer and use it in GitHub Desktop.
Save adhummer/750327518a2ef0c7cf42 to your computer and use it in GitHub Desktop.
//Edit this based on the max amount you want to spend on a given day.
var maxSpend = 1000;
function main () {
var currentAccount = AdWordsApp.currentAccount();
var stats = currentAccount.getStatsFor("TODAY");
var cost = stats.getCost();
Logger.log("Account has spent " + cost + " so far.");
if (cost > maxSpend) {
campaign.pause();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment