Google Ads Budget Pacing Script:
Code, Setup, and Alert Thresholds

Budget pacing is one of the most overlooked yet impactful parts of Google Ads management. Spend too fast, and you’ll burn your budget in the first week. Spend too slow, and you’ll miss high-intent clicks. For advertisers in the US and Canada, where competition is steep and costs per click are high, keeping spend on track can make or break campaign performance.

In this guide, we’ll break down how to automate budget pacing with Google Ads scripts, set smart alert thresholds, and implement everything step-by-step — including full, ready-to-use code.

What is Budget Pacing and Why It Matters

Budget pacing is the process of controlling how quickly you spend your allocated budget across a set period (usually a month).

Common pacing issues include:

  • Front-loading spend: Campaigns spend aggressively early, leaving no budget for the rest of the month.
  • Under-delivery: Campaigns spend too slowly and miss traffic and conversions.

By implementing an automated pacing script, you can keep spend aligned with your target, reduce manual monitoring, and respond faster to changes.

Manual vs. Automated Pacing

Manual options:

  • Google Ads’ built-in Pacing Insights page shows whether your campaigns are limited by budget, on track, or projected to overspend.

Automated options:

  • No-code tools like Shopstory or Optmyzr allow easy pacing setups.
  • Google Ads scripts offer complete control, customization, and automation — perfect for advanced advertisers.

Core Features of a Good Budget Pacing Script

A high-performing pacing script should:

  • Track daily spend vs. monthly budget
  • Calculate % of budget used
  • Trigger alerts at key thresholds
  • Pause or resume campaigns automatically
  • Support MCC accounts

How to Set Alert Thresholds for Better Budget Management

Alert thresholds help you act before overspending becomes a problem. Common milestones:

  • 50% of budget — Good point to verify campaign efficiency
  • 90% of budget — Critical alert to prevent end-of-month shortage
  • 100% of budget — Automatic pause or manual review

Pro tips for thresholds:

  • Factor in seasonality (e.g., holidays may require faster spend early on)
  • Adjust based on daily CPC volatility
  • Send alerts via email and Slack for instant visibility

Google Ads Budget Pacing Script Code

1function main() {
2  var BUDGET_CAP = 5000; // Monthly budget in CAD or USD
3  var ALERT_THRESHOLDS = [0.5, 0.9, 1.0]; // 50%, 90%, 100%
4  var EMAIL_RECIPIENT = "your@email.com";
5  
6  var currentDate = new Date();
7  var daysInMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).getDate();
8  var dayOfMonth = currentDate.getDate();
9  
10  var monthToDateSpend = AdsApp.currentAccount()
11    .getStatsFor("THIS_MONTH")
12    .getCost();
13  
14  var expectedSpend = (dayOfMonth / daysInMonth) * BUDGET_CAP;
15  var spendRatio = monthToDateSpend / BUDGET_CAP;
16  
17  ALERT_THRESHOLDS.forEach(function(threshold) {
18    if (spendRatio >= threshold) {
19      MailApp.sendEmail(
20        EMAIL_RECIPIENT,
21        "Google Ads Budget Alert: " + (threshold * 100) + "%",
22        "Your account has spent " + Math.round(spendRatio * 100) + "% of the monthly budget."
23      );
24    }
25  });
26}

Step-by-Step Setup

  1. Log in to Google Ads.
  2. Navigate to Tools & Settings → Bulk Actions → Scripts.
  3. Click + Script.
  4. Paste the code above.
  5. Update BUDGET_CAP, ALERT_THRESHOLDS, and EMAIL_RECIPIENT.
  6. Click Authorize when prompted.
  7. Run a Preview to test without changes.
  8. Schedule the script to run daily.
  9. Monitor alerts and adjust thresholds as needed.

Enhancements & Advanced Options

  • Slack Alerts: Use webhooks for real-time Slack notifications.
  • Google Sheets Dashboard: Track pacing visually and share with clients.
  • AI Suggestions: Integrate with an LLM API to recommend budget reallocations.
  • Combine with Bid Scripts: Ensure pacing is aligned with bid strategies.

Common Pitfalls & How to Avoid Them

  • Script stops running due to expired authorization → Reauthorize regularly.
  • Time zone mismatches → Match Google Ads account timezone.
  • Over-aggressive pauses → Could harm delivery; review campaign learning phase first.

That's it!

Budget pacing scripts give you precision control over campaign spend, freeing you from constant manual checks and helping you meet monthly targets without overshooting.

Need a custom budget pacing setup for your campaigns? Contact me to get a tailored script built for your goals.

Ready to
hire?