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
- Sums this month's cost across enabled campaigns.
- Divides it by the days passed and projects the rest of the month at that average.
- Compares the projection with
MONTHLY_BUDGET. - 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
- In Google Ads, open Tools > Bulk actions > Scripts and create a script.
- Set MONTHLY_BUDGET and ALERT_EMAIL.
- Schedule it daily at 08:00.
Questions
Does it change budgets?
No. It only sends the email; changing the budget stays with you.