Files
memind/.cursor/rules/mindspace-analytics-creator-username.mdc
T
john c122bd5664 feat(analytics): retire Rybbit and add SEO/GEO discovery tracking
Document Umami as the sole analytics platform, remove Rybbit proxy and
tracker code, and classify public page traffic with discovery_channel for
adm SEO/GEO dashboards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-12 01:34:05 +08:00

27 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: MindSpace 生成页埋点必须上报创建者 username,且不得用 owner_id identify 匿名访客
globs: mindspace-analytics.mjs,mindspace-analytics-discovery.mjs,mindspace-analytics.test.mjs,mindspace-analytics-discovery.test.mjs,server/portal-session-routes.mjs,server/portal-integration-services-bootstrap.mjs
alwaysApply: false
---
# MindSpace Analytics — 创建用户昵称与 Public 身份
Umami「创建用户」依赖 `event_data.username` / session `username`。路径里的 MindSpace UUID **不是**昵称。
## 必须
- 服务端 `page_generated``sendMindSpaceAnalyticsEvent`)的事件属性 **必须**包含 `username`(创建者展示名,来自 `resolveAnalyticsOwnerLabel`
- 可同时保留 `owner_label` 作兼容,值与 `username` 相同
- Public HTML 内嵌脚本的 `metadata` **必须**继续带 `username`(给 scroll/click 等客户端事件)
## 禁止(避免破坏访客统计)
- Public **匿名**访问路径 **禁止** `umami.identify(owner_id, …)` / 把创建者 ID 当作访客 `id`
- 仅已登录 viewer 可 `identifyViewer()`;不得为了补创建用户昵称而恢复「全员 identify 创建者」
## 改完必跑
```bash
node --test mindspace-analytics.test.mjs mindspace-analytics-discovery.test.mjs
```