Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsmith/a48f7bae647131128e29561a697a440d to your computer and use it in GitHub Desktop.
Save wpsmith/a48f7bae647131128e29561a697a440d to your computer and use it in GitHub Desktop.
AdWords Scripts - Minimize Overdelivery
//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