Monthly Budget Cap
Adds the monthly per-campaign budget cap Google Ads doesn't have: label a campaign 'budget::1500' and it is paused once month-to-date spend hits 1500, then re-enabled automatically when the new month starts.
by Victor Kaugesaar & Frederic Harnois (concept), chiliad (rewrite)·github.com/kaugesaar/adwords-scripts
Overview
Monthly Budget Cap enforces a hard month-to-date spend limit per campaign using labels. Label any campaign 'budget::<amount>' (in account currency) and the script pauses it the hour its month-to-date cost reaches that amount, tagging it with a marker label. On the first run of a new month spend resets, so every campaign the script paused is re-enabled and the marker removed. Campaigns you paused yourself are never touched.
Setup
- 1Open your Google Ads account and go to Tools → Bulk Actions → Scripts.
- 2Click the + button to create a new script and paste the code below.
- 3Create labels like budget::500 or budget::12000 and apply one to each campaign you want capped.
- 4Optionally set EMAIL_ADDRESS to get notified when campaigns are paused or resumed.
- 5Preview once to verify, then schedule the script to run hourly.
Configuration Variables
| Variable | Default |
|---|---|
LABEL_PREFIX | budget:: |
PAUSED_MARKER_LABEL | Monthly cap: paused |
AUTO_RESUME | true |
EMAIL_ADDRESS | (empty) |
Expected Output
3 campaign(s) have a monthly cap label. [OK] Brand — Exact - spent 412.18 of 1500 (27%) [OK] Generic — Broad - spent 1289.40 of 2000 (64%) === Monthly Budget Cap === Paused this run: 1 Resumed this run: 0 [PAUSED] Competitor — Phrase - spent 501.63 of 500 cap Email sent to you@example.com
Notes
Spend is checked on each run, so with an hourly schedule a campaign can overshoot its cap by up to roughly one hour of spend. The cap compares against Google Ads reported cost for THIS_MONTH in the account time zone. Concept popularized by open-source scripts from Victor Kaugesaar and Frederic Harnois (MIT); rewritten for GAQL and Performance Max support.