Monitors remaining account budget (prepaid balance) across all accounts under an MCC label, calculates days until the budget runs out based on 7-day average spend, writes a summary to a Google Sheet, and sends Telegram alerts per account.
by Dmytro Tonkikh
Runs from your MCC account and processes every child account tagged with a specific account label. For each account it reads the active account budget via GAQL, computes the remaining balance, average daily cost, yesterday's and this month's spend, and the projected days until the budget hits zero. Results are written to a Google Sheet and pushed to Telegram so account managers know when a client balance needs topping up.
| Variable | Default |
|---|---|
SPREADSHEET_URL | YOUR_SPREADSHEET_URL |
SHEET_NAME | Balance |
ACCOUNT_LABEL | Balance |
TELEGRAM_BOT_TOKEN | (empty) |
ACCOUNT_NOTIFICATIONS | {} |
📌 Client A 💰 Remaining budget: 1 240 EUR 📅 Days to 0: 15 📊 Avg. 7-day spend: 85 🔍 Spent yesterday: 92 📈 Spent this month: 940 Report written: 8 account(s) → Balance
Requires an MCC (manager) account — executeInParallel processes up to 50 child accounts per run. Only accounts with an approved account-level budget that has a finite spending limit (prepaid or invoiced billing with a cap) report a balance; pay-as-you-go accounts and budgets with an unlimited spending limit are skipped. The Telegram alert links the account name to the Google Ads billing page using the account's OCID, which the script fetches automatically.