Plausible analytics reports to Discord (migration 065)

Daily (yesterday) and weekly (Mondays, last 7 days vs the 7 before)
summaries: visitors, pageviews, bounce rate, visit length, top pages
and sources. Each has its own switch in Site settings > Reports; off
until PLAUSIBLE_API_KEY and DISCORD_WEBHOOK_URL are set. Sent at 8:00
REPORT_TZ (default America/Chicago); analytics_reports keeps one a day.
node src/analyticsReport.js daily|weekly sends one by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-10-04 21:44:25 -05:00
parent b8012c75e9
commit 636388730f
6 changed files with 254 additions and 1 deletions

View file

@ -34,6 +34,8 @@ export const siteSettings = {
text("access_group_viewer"),
text("access_group_editor"),
text("access_group_admin"),
enumeration("report_daily", ["on", "off"]),
enumeration("report_weekly", ["on", "off"]),
],
children: [