MCC budget pacing script for Google Ads
A free, read‑only Google Ads Script for manager accounts. It sets each client account’s month‑to‑date spend against even pace, beside Google’s 2 times daily and 30.4 times monthly limits, and writes one pacing table to a Google Sheet. MIT licensed.
Configures the script in this tab. Copy or download the MIT .js file and paste it into Google Ads Scripts. Where your data goes
mcc-
4 KB · 146 lines
- Reads
- campaign
- Writes
- Your Google SheetOptional email
- Changes in Google Ads
- None
- Runs in
- Manager account
- Suggested frequency
- Daily
- License
- MIT
/** * MCC 30.4x Budget Pacing Guardrail * Read-only Google Ads Script (MIT License) * Copyright (c) 2026 Parallel AI, Inc. * https://www.withparallel.ai * Docs & configurator: * https://www.withparallel.ai/scripts/mcc-budget-pacing-guardrail * Repository: * https://github.com/parallel-ai-inc/google-ads-scripts * * Changes in Google Ads: None (reads via AdsApp.search). * Google Ads is a trademark of Google LLC. Parallel AI is * not affiliated with or endorsed by Google. */const CONFIG = { OVERPACE_ALERT_PCT: 15, UNDERPACE_ALERT_PCT: 20, INCLUDE_PAUSED_CAMPAIGNS: true, SPREADSHEET_URL: "", EMAIL_RECIPIENTS: "",};Lines 23 to 146The script body, the same for every setting
const MONTH_MULTIPLE = 30.4;const DAY_MULTIPLE = 2;function main() { const pacingRows = []; const alertRows = []; const accounts = AdsManagerApp.accounts().get(); while (accounts.hasNext()) { const account = accounts.next(); AdsManagerApp.select(account); const stats = summarizeAccount(); if (stats.dailyBudget <= 0 && stats.mtdSpend <= 0) continue; const row = [ account.getCustomerId(), account.getName(), round2(stats.dailyBudget), round2(stats.dailyBudget * DAY_MULTIPLE), round2(stats.dailyBudget * MONTH_MULTIPLE), round2(stats.mtdSpend), round2(stats.evenSpend), round1(stats.variancePct) + "%", stats.status, ]; pacingRows.push(row); if (stats.status !== "ON_PACE") alertRows.push(row); } const sheet = openOrCreateSheet( CONFIG.SPREADSHEET_URL, "Parallel AI - MCC 30.4x Budget Pacing" ); const headers = [ "Account ID", "Account", "Daily budget", "2x daily limit", "30.4x month limit", "MTD spend", "Even pace", "Variance", "Status", ]; writeTab(sheet, "Account pacing", headers, pacingRows); writeTab(sheet, "Alerts", headers, alertRows); if (CONFIG.EMAIL_RECIPIENTS && alertRows.length > 0) { MailApp.sendEmail( CONFIG.EMAIL_RECIPIENTS, "MCC pacing alerts: " + alertRows.length + " accounts", "Review 30.4x pacing table in: " + sheet.getUrl() ); } Logger.log("Sheet URL: " + sheet.getUrl());}function summarizeAccount() { const tz = AdsApp.currentAccount().getTimeZone(); const dayOfMonth = Math.max(1, Number( Utilities.formatDate(new Date(), tz, "d") )); const statusFilter = CONFIG.INCLUDE_PAUSED_CAMPAIGNS ? "campaign.status != 'REMOVED'" : "campaign.status = 'ENABLED'"; const query = [ "SELECT campaign.id, campaign.status,", " campaign_budget.resource_name,", " campaign_budget.amount_micros,", " campaign_budget.explicitly_shared,", " metrics.cost_micros", "FROM campaign", "WHERE segments.date DURING THIS_MONTH", " AND " + statusFilter, ].join("\n"); const seenBudgets = {}; let dailyBudget = 0; let mtdSpend = 0; const rows = AdsApp.search(query); while (rows.hasNext()) { const row = rows.next(); const metrics = row.metrics || {}; mtdSpend += Number(metrics.costMicros || 0) / 1e6; const c = row.campaign || {}; const b = row.campaignBudget || {}; const key = b.resourceName || c.id; if (c.status === "ENABLED" && !seenBudgets[key]) { seenBudgets[key] = true; dailyBudget += Number(b.amountMicros || 0) / 1e6; } } const evenSpend = dailyBudget * dayOfMonth; const variancePct = evenSpend > 0 ? ((mtdSpend - evenSpend) / evenSpend) * 100 : 0; let status = "ON_PACE"; if (variancePct >= CONFIG.OVERPACE_ALERT_PCT) { status = "OVERPACING"; } else if (variancePct <= -CONFIG.UNDERPACE_ALERT_PCT) { status = "UNDERPACING"; } return { dailyBudget, mtdSpend, evenSpend, variancePct, status };}function round2(n) { return Math.round(n * 100) / 100; }function round1(n) { return Math.round(n * 10) / 10; }function safeCell(val) { if (typeof val !== "string") return val; if (/^[=+@]/.test(val) || /^-[^0-9.]/.test(val)) return "'" + val; return val;}function openOrCreateSheet(url, fallbackName) { return url ? SpreadsheetApp.openByUrl(url) : SpreadsheetApp.create(fallbackName);}function writeTab(spreadsheet, name, headers, rows) { let tab = spreadsheet.getSheetByName(name); if (!tab) tab = spreadsheet.insertSheet(name); tab.clearContents(); const safeRows = rows.map((r) => r.map(safeCell)); const data = [headers].concat(safeRows); tab.getRange(1, 1, data.length, headers.length).setValues(data);}Install it in your manager account
- Set the thresholds on this page, then copy the script or download the .js file.
- In your manager account, open Tools, then Bulk actions, then Scripts, and add a new script.
- Paste the script over the starter code and give it a name.
- Google Ads asks you to authorize the script the first time. That happens in your own account, under your Google login.
- Choose Preview. Copy the Google Sheet URL from the last log line and paste it into SPREADSHEET_URL so scheduled runs reuse one Sheet instead of creating a new one each time.
- Set its frequency on the Scripts page. Daily suits this script.
What it reads and the rules it follows
For each client account under the manager, one query on campaign, through AdsApp.search. It asks for this month’s cost and each enabled campaign’s daily budget.
- Over a billing month without budget changes, a campaign is charged at most 30.4 times its average daily budget, and any single day may spend up to 2 times it, for most campaigns.OfficialGoogle Ads Help, About average daily budgets
- Daily spend can exceed your average daily budget on high‑demand days, and Google states you never pay more than your daily or monthly spending limits.OfficialGoogle Ads Help, About overdelivery and your average daily budget
- Flagging accounts whose month‑to‑date spend diverges from even pace beyond your variance threshold surfaces runaway shared or daily budgets before month‑end.Practitioner rule
The Sheet it writes
Two tabs with the same columns. Account pacing has a row for each account, with its daily budget, 2 times that budget, 30.4 times that budget, month‑to‑date spend, even pace to today and the variance between the last two. Alerts repeats the rows whose variance passes a threshold. With an alert email set, Google Ads Scripts sends one from your account when a run has an alert.
| Account ID | Account | Daily budget | 30.4x month limit | MTD spend | Variance | Status |
|---|---|---|---|---|---|---|
| 412-890-2311 | Bramble Creek Roofing | 240.00 | 7,296.00 | 4,284.00 | +19.0% | OVERPACING |
| 588-204-7719 | Alder & Pine Dental | 160.00 | 4,864.00 | 2,448.00 | +2.0% | ON_PACE |
| 703-511-9402 | Cinder Trail Gear | 310.00 | 9,424.00 | 3,441.00 | -26.0% | UNDERPACING |
| 829-440-1185 | Meridian Solar & Storage | 400.00 | 12,160.00 | 7,140.00 | +19.0% | OVERPACING |
| 914-602-3378 | Bayview Ortho Clinic | 190.00 | 5,776.00 | 2,793.00 | -2.0% | ON_PACE |
What it cannot tell you
- The status comes from variance against even pace, which is the daily budget times the day of the month in each account’s time zone. The 2 times and 30.4 times columns are Google’s limits for reference and do not set the status.
- A budget is read at today’s amount. A budget changed during the month is treated as if it had held all month.
- Google states both limits for most campaigns. The Help page names the campaign types it treats differently.
- It changes no budget and pauses nothing.
- A manager account with many client accounts takes longer to run, and Google Ads Scripts limits how long one run may take.
Where your data goes
This page builds the script’s text in your browser tab. It asks for no login and connects to no Google Ads account.
A Sheet address or an alert email you type goes into the script’s text, so the copy is ready to paste. The link you copy holds thresholds and switches only, in the part of the address after the # sign, which a browser does not send when it requests a page.
Once pasted, the script runs inside Google Ads Scripts under your Google account. It reads the account, writes to your Google Sheet and sends the optional email from your account. Nothing in it calls Parallel AI.
Site analytics are separate from the script. If you accepted analytics cookies, they record how pages on this site are used, which can include what is on the screen. The privacy policy covers site analytics and your consent settings.
On a live account
A script writes the same table on every run. Parallel AI is the AI agent platform for Google Ads. A Google Ads AI agent reads budgets and spend from every connected account, finds the campaigns heading past plan, explains each one, and writes the pacing Sheet.
Questions and answers
Is the script free?
Yes. It is open source under the MIT license, with no login, no trial and no email address. The whole file is on this page and on GitHub.
Does the script change any budget?
No. It reads with AdsApp.search and writes to a Google Sheet. It has no call that changes a budget, a bid or a status.
What is the 30.4 times monthly limit in Google Ads?
Google Ads charges a campaign at most 30.4 times its average daily budget in a month, for most campaigns. 30.4 is the average number of days in a month. One day can spend up to 2 times the average daily budget.
Does it run in a single account?
No. It walks the client accounts of a manager account, so it belongs in the manager’s Scripts page. For one budget, the budget pacing calculator models the same limits.
What counts as overpacing?
Month‑to‑date spend above even pace by at least the overpace threshold. Even pace is the daily budget times the day of the month. Underpacing is the same test below it.
Does the script need access to my Google account?
Google Ads asks you to authorize the script the first time it runs. That grant is between you and Google, inside your own account. Parallel AI receives nothing.
Google Ads is a trademark of Google LLC. Parallel AI is not affiliated with or endorsed by Google.
Pace every client account with the reason attached
Connect Google Ads and Parallel AI checks pacing across your connected accounts, explains each account heading over or under plan, and writes the result to a Sheet.
Starter $20, Pro $60 and Max $200 a month
You add a card to start the trial, then connect Google Ads.