fix(analytics): include username on page_generated events
Memind CI / Test, build, and release guards (pull_request) Successful in 5m34s

Umami creator labels read event_data.username; server events only sent
owner_label, so dashboards fell back to MindSpace UUID path segments.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-06 15:25:09 +08:00
parent 26846a0274
commit b300cb5e04
4 changed files with 35 additions and 2 deletions
+3 -1
View File
@@ -60,6 +60,7 @@ export function sendMindSpaceRybbitEvent({
const owner = pseudonymizeAnalyticsId(ownerId, config.idSecret);
if (!owner) return Promise.resolve(false);
const endpoint = `${String(config.rybbitUrl || 'https://rybbit.tkmind.cn').replace(/\/$/, '')}/api/track`;
const username = resolveAnalyticsOwnerLabel({ displayName: ownerLabel });
const payload = {
site_id: String(config.siteId),
type: 'custom_event',
@@ -76,7 +77,8 @@ export function sendMindSpaceRybbitEvent({
agent_run_id: String(agentRunId || ''),
channel,
owner_segment: String(ownerSegment || 'unknown'),
owner_label: resolveAnalyticsOwnerLabel({ displayName: ownerLabel }),
username,
owner_label: username,
}),
};
return fetch(endpoint, {