Flexible Budgets
Dynamically adjusts a campaign's daily budget each day according to a custom distribution scheme, useful when a fixed total budget must be spent over a specific promotional period. Supports even and weighted (front/back-loaded) allocation strategies.
by Google (original), chiliad (adaptation)·developers.google.com/google-ads/scripts/docs/solutions/flexible-budgets
Overview
Flexible Budgets tracks budget flights defined in a Google Sheet — each row targets campaigns by label, by a substring of the campaign name, or by exact name, with a total budget and start/end dates. Each run it sums the matched campaigns' spend so far, projects the total at the current daily pace, writes the projection back to the sheet, and emails an alert when a flight is forecast to over- or under-spend. Read-only: it never changes your budgets. The config sheet is created automatically on first run.
Setup
- 1Run the script once with SPREADSHEET_URL blank — it creates a Flights config sheet and logs the URL.
- 2Open that sheet and add one row per flight: Match by (label / contains / name), the label/text/campaign name, total budget, and start/end dates (yyyy-MM-dd).
- 3Set SPREADSHEET_URL to the sheet URL and re-run.
- 4Optionally set EMAIL_ADDRESS to receive pacing alerts and tune ALERT_THRESHOLD.
- 5Schedule daily so projections and alerts stay current.
Configuration Variables
| Variable | Default |
|---|---|
SPREADSHEET_URL | "" |
SHEET_NAME | "Flights" |
ALERT_THRESHOLD | 0.10 |
EMAIL_ADDRESS | "" |
Expected Output
Created config sheet: https://docs.google.com/spreadsheets/d/.../edit Flight "Summer Sale" (label, 6 campaign(s)): spent 2840.00 of 5000, projected 5680.00 -> OVER Emailed 1 alert(s) to you@example.com
Notes
Read-only — never changes budgets. When one row matches multiple campaigns, they share the row's total budget (spend is summed). 'contains' matching uses GAQL LIKE and is case-sensitive. Projections are noisy in the first day or two of a flight and stabilize as it progresses.