Cross-Platform Ad Budget Monitoring

Automation · Internal operations tool for a digital agency · 2025

Impact

24/7
Monitoring (was business hours only)
Zero
Overspend after deployment (previously: SGD 70K+ in incidents including one SGD 50K event)
<1 min
Alert to resolution (Slack + payment link)

Problem

The agency managed ad accounts across Meta and Google Ads for multiple clients. Before I took over the digital department, overspend incidents had happened multiple times, totalling SGD 70K+ in losses (including one single SGD 50K incident). SOP was added, but it still relied on people checking manually. Weekends and after-hours were unmonitored.

After I took over the digital department, I decided to replace the SOP with automated monitoring. Budget compliance is a logic problem (spent vs limit), not a judgment call. A machine does not forget, does not skip weekends, and does not misread numbers. The constraint was: no dedicated budget for external tools or API subscriptions, so everything had to be built with what we already had.

Google Ads Script execution history showing successful automated runs Budget Controller execution log showing spend ratio, pacing calculations

Key Decisions

Architecture

Meta Ads Monitoring (n8n)
Google Sheet (account list: ID, name, active flag) | v n8n Workflow 1 (hourly trigger) |-- Read all active accounts from sheet |-- For each account (batch processing): | Facebook Graph API | Fetch: balance, amount_spent, spend_cap, account_status |-- Transform: convert cents to dollars, format timestamps |-- Write back to Google Sheet (per-account row update) | v n8n Workflow 2 (called per account, or via webhook) |-- Fetch account details from Facebook Graph API |-- Check: account_status != 1 (not active)? |-- Check: outstanding balance? |-- If anomaly detected: | Slack Block Kit message to #ad-account-monitoring | Contains: account name, status, balance, payment link | @mentions the responsible account manager |-- Write status back: success/failed + error message |-- n8n built-in execution tracking for every run
Google Ads Monitoring (MCC Script)
Google Sheet (account budgets + alert threshold) | v Google Ads Script (scheduled, runs at MCC level) |-- Read account budgets and email settings from sheet |-- For each configured account: | Skip if no active campaigns | Fetch: monthly spend, yesterday spend, today spend | Calculate: spend ratio, remaining budget, daily pacing | |-- If monthly spend >= budget: | Auto-pause ALL active campaigns | Send URGENT email with spend details | |-- If spend ratio >= alert threshold (default 90%): | Send WARNING email with pacing info | |-- Log: processed count, skipped count |-- Every execution logged by Google Ads Script runtime

Transferable Pattern

Replacing manual SOPs with automated monitoring for rule-based compliance. Applicable to any business with budget limits, inventory thresholds, or SLA targets that need 24/7 enforcement without relying on people to remember.

Tech Stack

n8n Facebook Graph API Google Ads Scripts (MCC) Google Sheets API Slack Block Kit