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).
This commit is contained in:
justin 2026-06-30 16:49:28 -05:00
parent 60d5d3b9d8
commit 9abd08c305
2 changed files with 82 additions and 11 deletions

View file

@ -0,0 +1,6 @@
# Daily trucking price A/B/C scoreboard -> Telegram, but ONLY when there was at
# least one PAID sale in the look-back window (silent on no-sale days, per
# request). Combines HUMAN clicks (Umami, bot-filtered) + PAID orders per arm.
# Runs as deploy (needs docker exec for psql + reads /opt/performancewest/.env).
# 18:00 UTC (1pm CT) so the day's morning sends + any same-day orders are in.
0 18 * * * deploy python3 /usr/local/bin/coupon_ab_scoreboard.py --days 14 --telegram --arms 20,30,40,0 >> /opt/performancewest/logs/pw-coupon-ab-report.log 2>&1