Commit graph

2 commits

Author SHA1 Message Date
justin
9abd08c305 report: daily price A/B/C scoreboard to Telegram (silent on no-sale days)
Adds --telegram mode to coupon_ab_scoreboard.py + a daily cron (18:00 UTC).
Pushes the per-arm clicks+conversions table to Telegram ONLY when there was at
least one PAID sale in the window; stays silent otherwise (per request, no
all-zero spam). Creds read from /opt/performancewest/.env like the other
monitors. Verified live: silent at 0 sales (14d), sends at 5 sales (30d).
2026-06-30 16:49:28 -05:00
justin
60d5d3b9d8 analytics: attribute price-test arm per click + A/B/C scoreboard
So we can see whether a discount helps the CTA (clicks) AND the sale (paid
orders), per arm:

1. pw-analytics.js: include the ?code= (the price-test arm) on the campaign-click
   Umami event, and fire it when EITHER a utm OR a code is present (coupon links
   often carry code with no utm, so those human clicks were being dropped). Also
   strip a stray @TrackLink suffix Listmonk glues onto the last query value.

2. coupon_ab_scoreboard.py: one report combining HUMAN clicks (Umami, already
   bot-filtered) and PAID conversions (compliance_orders) per arm. Discount arms
   map by code->pct (campaign-daily:<date>:<pct> marker); the no-code control arm
   is recovered by re-hashing customer_email the same way the builder bucketed it.
   Prints clicks, paid orders, revenue, and click->order per arm.
2026-06-30 16:39:26 -05:00