Skip to content

08 — Post-Campaign Report

Parent spec: 2026-05-23-08-advertiser-dashboard-design.md §5 Research: research/cf-cost-projection.md (D1 aggregate cost model)

Sequence from the T+24h cron trigger through bidder email + dashboard render.

After an advertising day ends, a scheduled job requests a report built from traffic, click and conversion data. The service stores the report, notifies the advertiser and serves authorized downloads through the dashboard.After an advertising day ends, a scheduled job requests a report built from traffic, click and conversion data. The service stores the report, notifies the advertiser and serves authorized downloads through the dashboard.
  • Trigger window: cron runs hourly; selects auctions whose ad-day ended in the last 2 hours but have no report yet. Idempotent — report_generated_at IS NULL guard prevents double-send.
  • Email delivery: Resend with retry-on-4xx via Resend’s own queue. On terminal failure, dashboard banner surfaces “Report email could not be delivered” (08 spec E10).
  • ROAS nullability: if there are zero purchase rows in conversion_events, ROAS is null in JSON; email body shows “ROAS unavailable — install pixel”; dashboard shows ”—” with tooltip “Tracking active, no purchases yet”.
  • PDF caching: R2 object retained 90 days; re-render on demand if expired or template-version bumped.
  • Privacy: all metrics are aggregate counts; no per-visitor identifiers leave D1.
  • Channel summary: email (primary delivery) + dashboard render (full interactive view) + CSV/PDF export (download).