← All projects

Campaign Analytics Exports

via Awesome Motive, Inc. · completed

Built OptinMonster's Analytics Export engine + redesigned Campaign Analytics screen — CSV export of campaign × variation × top-page performance (21 columns) with live row estimates, instant browser download under 5k rows, and S3 + email delivery for large exports.

Solo-owned end-to-end (PR #7260, 124 commits): Vue 3 SPA rewrite of the Campaign Analytics screen plus a new V3 export API, analytics builder/exporter, and background delivery pipeline. The feature lets users export campaign analytics scoped by campaign, folder, or domain, with date presets + custom ranges, selectable columns (core / revenue / split-test groups), and a live estimate footer that routes to instant browser CSV or async email via S3 zip. The hard part was scale: hundreds of campaigns × variations meant one remote analytics call per variation, 100s proxy kills, 512M OOMs from daily time-series payloads, and a silent 1500-row listing cap that truncated both estimate and CSV with no signal. What I did: capped estimates at 5k rows with a 45s deadline + DB-only minimum bound for instant UI feedback, made analytics fetch concurrent (rolling curl_multi, 20 in flight, dates dropped, window-bounded memory), shared estimate→export via TTL cache with truncation-aware gating, fixed the listing cap (limit PHP_INT_MAX) and a post-merge revenue N+1 (cursor()+with() → get()+with(), 10k queries → 2.2/campaign on a 353-campaign account), and hardened with CSV-injection sanitizing, kill-switch, per-bucket rate limiting, and validate-before-limit.