How We Built an Accountability Layer for Programmatic Advertising — and Cut CPA by 21%
Programmatic advertising is a black box. Budgets flow through dozens of intermediaries — DSPs, exchanges, data segments, fee layers — and by the time a conversion happens, nobody can tell you which part of the supply chain actually earned it.
We decided to fix that.
The Problem
Our client, a leading AdTech group, was running large-scale programmatic campaigns. They had spend. They had data. What they didn't have was visibility.
Every automated optimization happened silently. No audit trail. No contribution scoring. No way to tell which DSP was earning its fee and which was just taking a cut.
The brief: build a platform that makes every dollar traceable and every automated decision reviewable.
What We Built
A full Media Economics Platform — from zero to production.
The platform connects to the client's data and maps the entire media supply chain in real time. It measures each participant's contribution, identifies budget duplication, and automatically redirects spend to working media.
Stack: React · Next.js · TypeScript · Node.js · Python · PostgreSQL · ClickHouse · Kafka
1. High-Volume Data Ingestion Pipeline
Programmatic generates millions of events. We solved scale with columnar storage (ClickHouse) and streaming aggregation via Kafka — processing events in near real-time without batch lag.
2. Supply Chain Attribution Model
Continuous contribution scoring across DSP and exchange layers. Each participant in the supply chain gets a measurable score based on actual conversion impact — not last-click, not proxy metrics.
3. Policy Pack Engine
Versioned decision rules that auto-attach to every automated action. Every optimization the system makes is governed by an explicit, auditable policy — and you can always trace which version was active at the time.
4. Trace Receipt System
An immutable log of every optimization decision. Each entry includes: what changed, why it changed, which policy triggered it, and what measurable impact followed. Fully reproducible. No black boxes.
5. Audit Viewer
A human-in-the-loop interface that surfaces automated decisions for review. Every action the system takes is visible, explainable, and challengeable by a real person.
6. DSP & Exchange Integrations
Native integrations across major DSPs and ad exchanges — the platform pulls live data and pushes optimization signals back into the buying stack.
Technical Challenges
Scale without latency. Programmatic events arrive in massive, continuous bursts. Relational databases can't keep up. We used ClickHouse for columnar analytics and Kafka for streaming ingestion — giving us real-time attribution at scale.
Continuous attribution. Most attribution models run in batch. We built continuous contribution scoring so the platform knows, at any moment, which supply chain participants are performing. No waiting for end-of-day reports.
Full reproducibility. Audit isn't just about logging — it's about being able to replay any decision. Every trace receipt captures the full context: data state, policy version, and outcome. Any decision can be reconstructed exactly.
Results
From a live production campaign:
| Metric | Before | After |
|---|---|---|
| CPA | $39.50 | $31.20 |
| Change | — | −21% |
| Conversions | baseline | +8% |