Agency SEO and Ads Platform

A full-stack SEO and paid-ads operations platform built solo for a healthcare marketing agency in 16 days: rank tracking, technical audits, security scans, closed-loop ads optimization, AI search visibility, and one-click WordPress fixes with rollback.

  • Next.js
  • TypeScript
  • PostgreSQL
  • Prisma
  • BullMQ
  • PHP
  • Docker
  • Claude API

The problem

A healthcare marketing agency was paying for a third-party reporting tool and still working across a scatter of dashboards: rank trackers, ad consoles, analytics, audit tools, and manual WordPress edits. Data lived everywhere, fixes lived nowhere, and nothing connected what clients paid for to what actually got done on their sites and ad accounts.

What it does

One platform, one warehouse, eight data-source integrations: Google Analytics 4, Google Search Console, Google Ads, the Meta Marketing API, SERP and keyword data, PageSpeed Insights, US Census demographics, and search-question research, plus the Claude API for content generation.

  • Per-client dashboards covering analytics, search performance, Core Web Vitals, audit issues, security, rankings, opportunities, AI visibility, ads, and shareable reports, with role-based access across five roles and enforced two-factor authentication.
  • Nightly background engines: ETL into a local warehouse with historical backfill (nearly 500k rows verified against source), weekly rank tracking, a crawler-driven technical audit (23 checks with client-facing fix guidance), a security scanner (15 checks), and ads ingestion for Google and Meta with automated findings scans chained after each sync.
  • Closed-loop ads optimization: ten automated checks for wasted spend, disapproved ads, conversion-tracking gaps, and ad fatigue, with safe write-back (pause, budget change, negative keywords) gated behind manager roles and typed confirmation, plus a before/after ledger and rollback.
  • One-click WordPress fixes through a companion PHP plugin with an HMAC-signed REST API: SEO titles, meta descriptions, and image alt text pushed live to client sites with a full audit trail and rollback.
  • An opportunity engine that cross-references organic data, competitor gaps, and paid search terms into one prioritized queue. A search term that converts in paid ads but does not rank organically becomes a one-click content brief.
  • AI search visibility (AEO) tracking: automated prompts against ChatGPT and Perplexity with citation detection for the client versus competitors, at under $0.10 per prompt-engine pair.

Engineering practices worth noting

  • Spec-first, reviewed, then verified live. Every milestone got a written spec, test-driven implementation, and an adversarial review pass by a second model instance before merge. Reviews caught blocking bugs before they shipped, including a role-based-access hole and a query-injection path in Google Ads Query Language strings.
  • Live verification caught what unit tests missed. The Meta API silently paginates at 25 rows, location names required exact database matches, and a hardcoded ads API version had sunset. Each finding became a fix plus a regression test.
  • Never-throw external clients. Every third-party API client is config-gated and returns typed results instead of throwing, so a vendor outage degrades one panel rather than the whole app.
  • Idempotent finding lifecycles. Audit, security, and ads findings are reconciled in a single transaction anchored to the last successful scan. Ignored findings never resurface, recurring ones reopen with fresh timestamps, and failed data pulls can neither create nor auto-resolve findings.
  • Metered spend discipline. Every paid API is budget-gated with pre-flight quota checks and per-scan caps, with no automatic fanout on expensive paths.

Outcomes

  • Live in production from day two of development, redeployed continuously, with roughly 98 client onboardings queued at handoff.
  • 425k search-query rows and 21k analytics rows backfilled and spot-checked exact against source.
  • The ads engine analyzed a real account ($1,731 spend, zero conversions) and correctly flagged missing conversion tracking, plus $37 of wasted spend across 16 non-converting search terms with negative-keyword candidates.
  • Live write-back proof: a negative keyword applied to a real ad account, confirmed via re-query, then rolled back and confirmed removed.
  • The opportunity engine generated 72 prioritized opportunities from one client’s 43k search queries, including 22 “converts in paid, absent in organic” content plays for another account.

Status

Delivered and in production for the agency, with documentation and runbooks for handoff. The thinking behind its AI-visibility work carried forward into Obelisk, the standalone SEO and answer-engine platform.

Questions

FAQ

What is the Agency SEO and Ads Platform?

A full-stack SEO and paid-ads operations platform Brian Powell designed and built solo for a healthcare marketing agency. It consolidates rank tracking, technical audits, security scanning, Google and Meta Ads management, AI search visibility tracking, and automated WordPress fixes into one system, replacing a paid third-party reporting tool.

How fast was it built?

Empty repo to production in 16 days, roughly 51,000 lines of TypeScript across 60 database models, a companion WordPress plugin in PHP, and 1,257 automated tests. The velocity came from a disciplined AI-assisted workflow with written specs, test-driven implementation, adversarial pre-merge review, and live production verification for every milestone.

Can it make changes to live client sites and ad accounts?

Yes, safely. WordPress fixes and ads changes (negative keywords, pauses, budget changes) capture before-state, require typed confirmation, record an applied-or-failed ledger entry, and support one-click rollback. A failed mutation can never be recorded as a success.

Does it track AI search visibility?

Yes. It runs automated prompts against ChatGPT and Perplexity, detects whether the client or its competitors are cited in the answers, and keeps the scans spend-capped so AI visibility tracking stays affordable per client.