On a busy day, Google Ads can spend up to two times your average daily budget on a campaign. That is the system working as designed, and most of the time nobody sees it before the next morning's report. A short script can tell you while the day is still running.

A budget alert script is a Google Ads script that reads what each campaign has spent today, compares it with its daily budget and emails you when the gap crosses a threshold you set. It changes nothing in the account: the decision stays yours.

Below: why today's spend deserves a watcher, the full script, read-only and under 40 lines, the five steps to install and schedule it, what it cannot see, and when you are better off without it.

Why Today's Spend Deserves A Watcher

Google's help center sets two limits. On any particular day, you never pay more than your daily spending limit, two times your average daily budget for most campaigns. In any particular month, you never pay more than your monthly spending limit, 30.4 times that budget, 30.4 being the average number of days in a month. When served costs go past either limit, Google will cover the difference.

That protection is built on the budget you set, and it follows that budget wherever it goes. A daily budget typed with one zero too many gets daily and monthly limits ten times higher, applied just as faithfully. A traffic spike can push a campaign toward its daily ceiling, all within the rules. The account shows all of it to whoever opens the right report at the right time. The script opens it for you, every hour if you want.

The Script: Read, Compare, Alert

Paste it as is into a new script. The only line to change before a first run is the email address.

// Budget alert: reads today's spend per budget, emails you above a trigger. Changes nothing.
const EMAIL = 'you@example.com';
const RATIO = 1.5;  // alert above 1.5 x the average daily budget
const CEILING = 0;  // optional daily cap per budget, in account currency (0 = off)

function main() {
  const account = AdsApp.currentAccount();
  const rows = AdsApp.search(
    "SELECT campaign.name, campaign_budget.resource_name, campaign_budget.amount_micros, " +
    "metrics.cost_micros FROM campaign WHERE campaign.status = 'ENABLED' " +
    "AND campaign_budget.period = 'DAILY' AND segments.date DURING TODAY");
  const budgets = {};
  while (rows.hasNext()) {
    const row = rows.next();
    const key = row.campaignBudget.resourceName;
    if (!budgets[key]) {
      budgets[key] = { daily: Number(row.campaignBudget.amountMicros) / 1e6, spent: 0, names: [] };
    }
    budgets[key].spent += Number(row.metrics.costMicros || 0) / 1e6;
    budgets[key].names.push(row.campaign.name);
  }
  const alerts = [];
  for (const key in budgets) {
    const b = budgets[key];
    if (b.spent > b.daily * RATIO || (CEILING > 0 && b.spent > CEILING)) {
      alerts.push(b.names.join(', ') + ': ' + b.spent.toFixed(2) + ' spent today, daily budget ' +
        b.daily.toFixed(2) + ' ' + account.getCurrencyCode());
    }
  }
  if (alerts.length > 0) {
    MailApp.sendEmail(EMAIL, 'Budget alert: ' + (account.getName() || account.getCustomerId()),
      alerts.join('\n'));
  }
}

What each part does:

  • The query asks for every enabled campaign on a daily budget, with today's cost. It goes through AdsApp.search, which returns fields in lowerCamelCase: cost_micros in the query becomes costMicros in the row. Amounts come in micros, one million micros for one currency unit, hence the division by 1e6.
  • The grouping by budget handles shared budgets. Several campaigns can draw on the same budget: their spend is added up under the budget's resource name, then compared once with the amount they share.
  • RATIO flags a day running well above the average daily budget. At 1.5, the email can leave before the campaign reaches the two-times daily limit.
  • CEILING, off by default, flags a budget whose amount itself is wrong, the case no ratio can catch. Set it to the highest daily spend you would ever accept for one budget.
  • The email lists every budget over a trigger, with the campaigns that share it, through MailApp.sendEmail. When everything is in line, nothing is sent.

Nothing in it changes a budget, a bid or a status. For a first script, I would always start with one that reads and alerts, and keep scripts that act on the account for later, once you trust what they read.

Install And Schedule It In Five Steps

The full installation path is in the guide Google Ads scripts: what they are and how to install one. Here are the steps that matter for this script.

  1. Step 1: create the script. Open the Scripts page of your account, create a new script and replace the default content with the code above.
  2. Step 2: put your own address. Replace you@example.com with your address. Keep it yours during the tests, since the next steps send real emails.
  3. Step 3: authorize. Before the first preview or run, Google Ads asks you to authorize the script: click Authorize now, then Grant access.
  4. Step 4: preview. Preview mode only affects calls that go through AdsApp: an email sent with MailApp goes out whether the script is previewed or run. If no budget is over its trigger today, set RATIO to 0.1 for one preview to see the email arrive, then put it back to 1.5.
  5. Step 5: schedule it. A script can run hourly, daily, weekly or monthly. Choose hourly, so the email arrives while there is still time to act. Each run sends a new email while a budget stays over its trigger: if that turns into noise, raise RATIO.

What The Script Does Not See

  • The last hour. Clicks, impressions and cost are refreshed hourly in most cases: a run at 3 pm usually sees the spend up to around 2 pm, sometimes less when a system runs late.
  • Your clock. TODAY is evaluated in the account's time zone. If the account runs on New York time and you work from Europe, its day starts hours after yours.
  • Budgets for a custom period. The filter on DAILY leaves out campaign total budgets: comparing one day of spend with a budget for the whole period would tell you nothing.
  • Pay for Conversions campaigns. They have no daily spending limit, only the monthly one, so the two-times reference does not apply to them.

Going Further: Monthly Pacing, MCC And Ready-Made Scripts

For monthly pacing, the same logic works over a longer window: replace TODAY with THIS_MONTH and compare the month's spend with the daily budget multiplied by the number of days already elapsed. Above that line, the month is spending faster than its budget allows over 30.4 days, and the alert becomes a simple monthly budget script.

If you work as a Paid Search Manager, the person who runs search campaigns day to day, across several accounts under a manager account, the same check can run in all of them from a single script, as explained in What are MCC scripts in Google Ads.

Google also publishes complete scripts in its Solutions gallery, among them Flexible budgets and Account anomaly detector. For a selection of scripts to install first, read the best Google Ads scripts, ready to use. If you hesitate between a script and an automated rule for this job, Google Ads scripts vs automated rules compares the two. Every article on the subject is in the Google Ads scripts category.

My recommendation: install it today with your own address, preview it once with a low RATIO to see the email arrive, then schedule it hourly at 1.5. The day an email lands, open the campaign it names and find what changed before you touch the budget. To set the daily budget itself, the marketing budget calculator gives you a starting point. For an outside view on your PPC account, discover the Google Ads management service.