Files
memind/docs/local-analytics.md

1.9 KiB

Local Memind analytics (Umami + Rybbit)

Umami (optional)

Memind can still proxy /analytics/* to a local Umami service at http://127.0.0.1:3100.

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_DOMAINS=127.0.0.1,localhost

Rybbit runs on 105 as https://rybbit.tkmind.cn. Local Memind does not talk to 103 for analytics. It proxies same-origin /rybbit/* to Rybbit /api/* so the browser script stays first-party:

Generated Page
  -> /rybbit/script.js  -> https://rybbit.tkmind.cn/api/script.js
  -> /rybbit/track      -> https://rybbit.tkmind.cn/api/track
  1. In Rybbit, create one Site for the local host you use (127.0.0.1 or localhost). Do not create a Site per page or per user.

  2. Put the numeric Site ID and a local pseudonymization secret in Memind .env:

    MEMIND_RYBBIT_ENABLED=true
    MEMIND_RYBBIT_URL=https://rybbit.tkmind.cn
    MEMIND_RYBBIT_SITE_ID=2
    MEMIND_RYBBIT_ID_SECRET=<random-local-secret>
    
  3. Restart the local Memind server. Full generated HTML pages receive a same-origin /rybbit/script.js tracker. The tracker identifies the visitor with a stable pseudonymous owner ID, then records engagement events such as page_click, scroll depth, and dwell time. Initial pageviews come from Rybbit's site setting trackInitialPageView.

  4. Open Rybbit from local memind_adm → Analytics 配置 →「打开 Rybbit 分析后台」 (SSO). That path requires matching MEMIND_RYBBIT_SSO_SECRET / RYBBIT_SSO_EMAIL with the 105 Rybbit deployment.

Both integrations are fail-open: missing configuration or a down analytics service leaves page generation and page delivery unchanged. Do not expose the Rybbit or Umami dashboards directly to end users.