Manuel Porras

All work / Ad anomaly detection

Earlier project · Ad spend monitoring

An early-warning system for ad spend across 30+ clients

Before the agent fleet: a monitoring pipeline that checked every client’s Google Ads data each day and raised a Slack alert when spend or leads moved outside the normal range.

In short: A US marketing agency ran PPC campaigns for more than 30 clients without an early warning: overspend was noticed days later, and a drop in leads often only when the client called. I built a pipeline that pulled Google Ads data for every client daily, compared it with rolling baselines and sent critical deviations to Slack, sorted into three severity tiers. It was a rule-based earlier stage before the agent fleet; today each client has its own Claude Code agent that reads the ad accounts.

30+agency clients monitored (at the time)
3alert severity tiers
Dailydata pull and check per client

The problem

The agency ran PPC campaigns for more than 30 clients. There was no early warning for budget problems.

Overspend was noticed days after it happened. A drop in leads often surfaced only when the client called. The team checked dashboards by hand across several platforms, and anomalies slipped through.

What I built

  1. Collect. Spend and performance data from Google Ads, pulled daily for every client.
  2. Compare. Rolling baselines with thresholds that account for day-of-week patterns and seasonality.
  3. Classify. Each deviation is sorted into one of three tiers — critical, warning, info — by size and business impact.
  4. Alert. Critical findings go to Slack automatically, with context: what changed, by how much, and what the baseline was.

The system also tracked month-to-date budget pacing and projected the spend at the end of the month.

Fewer false alarms

An alert system that cries wolf gets muted. Two details kept it useful:

  • Inactive clients were excluded automatically. The list came from a sync with the team’s own budget spreadsheet in Google Sheets, so nobody had to maintain a second list.
  • Thresholds adapted to each account’s normal rhythm instead of using one fixed percentage for everyone.

A single dashboard showed all clients with a traffic-light status, budget progress bars and a drill-down per platform.

Where it led

This was rule-based monitoring, not an AI agent. But the lesson carried over: the team needs the one thing that changed, with context, in the channel they already use.

Today each client of the agency has its own Claude Code agent that reads the ad accounts via API — Google Ads, Google Local Services Ads, Microsoft Ads and Meta Ads — and answers the team’s questions in Slack. See the agent fleet.

Technology

Node.jsExpressPostgreSQLGoogle Ads APISlack APIGoogle Sheets API