feat: add privacy-friendly Umami page-view analytics (#15)

Cookieless, env-gated page-view tracking via Umami. The <Analytics />
component injects the script only when NEXT_PUBLIC_UMAMI_SRC and
NEXT_PUBLIC_UMAMI_WEBSITE_ID are both set, so local dev and forks send
nothing to our instance. Adds .env.example docs (section 6) and a
homepage footer privacy disclosure. No Cookie consent banner needed.
This commit is contained in:
Zonghao Yuan
2026-06-03 01:14:55 +08:00
committed by GitHub
parent 639201cd38
commit 6ddbe7d377
4 changed files with 34 additions and 0 deletions
+12
View File
@@ -55,3 +55,15 @@ TTS_SPEECH_MODEL=mimo-v2.5-tts
# true → return a placeholder image instead of calling the image model.
# Text/story/voice still run normally. Great for iterating on TTS.
MOCK_IMAGE=false
# ---- 6. Analytics · Umami (optional — leave blank to disable) ------
# Privacy-friendly, cookieless page-view stats — no Cookie consent banner.
# Cloud: sign up at https://cloud.umami.is, add your site, copy its ID into
# NEXT_PUBLIC_UMAMI_WEBSITE_ID and use the cloud script URL:
# NEXT_PUBLIC_UMAMI_SRC=https://cloud.umami.is/script.js
# Self-host later: point SRC at your own instance — the integration is identical
# (no code change), e.g. NEXT_PUBLIC_UMAMI_SRC=https://stats.example.com/script.js
# Both blank → no script is injected (zero tracking). NEXT_PUBLIC_ vars are
# inlined at BUILD time, so set them in the build env (Vercel project settings).
NEXT_PUBLIC_UMAMI_SRC=
NEXT_PUBLIC_UMAMI_WEBSITE_ID=