Skip to content

Budget pacing alerts

Projects month-end spend from the month-to-date daily average and emails you when the projection misses the monthly budget by more than your threshold, with the daily budget that would land on target.

Try it

Shows an example of the output, not a run against your account.
Google Ads script
/**
 * Goodlabs Google Ads script: budget pacing alerts
 * Schedule: Daily at 08:00
 */
var CONFIG = {
  MONTHLY_BUDGET: 5000,
  ALERT_EMAIL: "media@yourdomain.com",
  MAX_OVERPACE_PERCENT: 15
};

function main() {
  var now = new Date();
  var totalDays = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate();
  var currentDay = now.getDate();
  var daysRemaining = totalDays - currentDay;

  var campaignIterator = AdsApp.campaigns()
    .withCondition("Status = ENABLED")
    .get();

  var mtdSpend = 0;
  while (campaignIterator.hasNext()) {
    var c = campaignIterator.next();
    var stats = c.getStatsFor("THIS_MONTH");
    mtdSpend += stats.getCost();
  }

  var dailyAverage = currentDay > 0 ? (mtdSpend / currentDay) : 0;
  var projectedTotal = mtdSpend + (dailyAverage * daysRemaining);
  var diffPercent = ((projectedTotal - CONFIG.MONTHLY_BUDGET) / CONFIG.MONTHLY_BUDGET) * 100;

  Logger.log("MTD Spend: $" + mtdSpend.toFixed(2) + " | Projected: $" + projectedTotal.toFixed(2) + " (" + diffPercent.toFixed(1) + "%)");

  if (Math.abs(diffPercent) > CONFIG.MAX_OVERPACE_PERCENT && CONFIG.ALERT_EMAIL) {
    MailApp.sendEmail(
      CONFIG.ALERT_EMAIL,
      "🚨 Google Ads Pacing Alert: " + (diffPercent > 0 ? "Overpacing" : "Underpacing") + " by " + diffPercent.toFixed(1) + "%",
      "Current MTD Spend: $" + mtdSpend.toFixed(2) + "\n" +
      "Projected Month-End Spend: $" + projectedTotal.toFixed(2) + "\n" +
      "Target Monthly Budget: $" + CONFIG.MONTHLY_BUDGET + "\n\n" +
      "Recommended adjusted daily budget: $" + ((CONFIG.MONTHLY_BUDGET - mtdSpend) / Math.max(daysRemaining, 1)).toFixed(2)
    );
  }
}

How it works

  1. Sums this month's cost across enabled campaigns.
  2. Divides it by the days passed and projects the rest of the month at that average.
  3. Compares the projection with MONTHLY_BUDGET.
  4. If it misses by more than MAX_OVERPACE_PERCENT (15% by default) either way, emails the projection and the daily budget that would hit the target.

Installation

  1. In Google Ads, open Tools > Bulk actions > Scripts and create a script.
  2. Set MONTHLY_BUDGET and ALERT_EMAIL.
  3. Schedule it daily at 08:00.

Questions

Does it change budgets?

No. It only sends the email; changing the budget stays with you.

Need one adapted to your account?

We write Google Ads scripts, set up server-side GA4 and build reports that answer a specific question.