feat: add attributable page analytics

This commit is contained in:
john
2026-07-20 20:49:44 +08:00
parent d479e89fc7
commit 1c82b34ad9
12 changed files with 144 additions and 11 deletions
+6 -1
View File
@@ -10,9 +10,14 @@ MEMIND_ANALYTICS_ENABLED=true
MEMIND_ANALYTICS_URL=http://127.0.0.1:3100
MEMIND_ANALYTICS_WEBSITE_ID=<website-id>
MEMIND_ANALYTICS_ID_SECRET=<random-local-secret>
MEMIND_ANALYTICS_IDENTITY_MODE=raw
MEMIND_ANALYTICS_DOMAINS=127.0.0.1,localhost
```
`MEMIND_ANALYTICS_IDENTITY_MODE=raw` sends the stable Memind user ID to an
explicitly approved first-party analytics service. Omit it elsewhere to keep the
pseudonymous default.
Create a second Umami Website for the Memind product shell. Keeping it separate
prevents chat, MindSpace, and feedback navigation from inflating generated-page
views. Do not create a Website per page or per user.
@@ -27,7 +32,7 @@ The product shell loads its tracker from the same-origin
transition, `product_click` for links/buttons, and 10/30-second route engagement
events. Query strings are restricted to a small allowlist and click labels never
copy arbitrary chat or generated-page text. Authenticated product events use the
same pseudonymous identity as generated pages while remaining in the separate
same configured identity as generated pages while remaining in the separate
product Website.
## Rybbit (recommended for behavior analytics)