The problem
Metrike's ad delivery ran on a third-party ad server. The company needed its own platform to serve display and video campaigns, measure them in-house and report to advertisers, agencies and publishers from one place.
What I built
As lead engineer I designed and built the replacement end to end:
- A multi-tenant admin and reporting hub in PHP/Laravel: advertisers, campaigns, creatives, publishers, zones and placements, a 7-step wizard that ends with a ready-to-paste tag, campaign dashboards with geography, video funnel and content verification, scheduled reports, conversion tracking, a BI API and scoped read-only access for external clients.
- Serving and ingestion APIs in Python/FastAPI, a JavaScript ad tag, and a Pub/Sub to BigQuery event pipeline.
- Display, HTML5 and video delivery: VAST 2.0 to 4.2, VMAP, VPAID, SIMID, OMID and companion ads, with IAB TCF v2 consent enforcement.
- Native Android (Kotlin) and iOS (Swift) SDKs: banners, interstitials, MRAID 3.0, fullscreen and outstream VAST video, viewability measurement and install/deep-link conversion attribution, published with public docs.
- Serve-time controls: layered invalid-traffic (IVT) filtering, render-integrity signals, GeoIP, brand-safety and GARM-risk targeting, device targeting, and dynamic creative optimization (CTR-based, Thompson sampling per zone).
- Prometheus and Grafana monitoring, and a k6 load-testing harness that checks for zero data loss against BigQuery.
Key decisions
- The ad tag requests the ad in parallel with the consent check instead of waiting for consent first. That is how time-to-creative came down 41% on broadband and 26% on slow 4G.
- The tag bundle was cut from 48 KB to 17 KB.
- Load tests verify every event against BigQuery, so capacity numbers come with a zero-data-loss check, not just request counts.
- The serving tier scales horizontally: capacity grows linearly with instances.
Results
- Ad tag time-to-creative down 41% on broadband and 26% on slow 4G.
- Server-side decisioning in about 5 ms.
- 200M+ ad events a day, handled by scaling the serving tier horizontally.
- Tag bundle reduced from 48 KB to 17 KB.





