fix(analytics): include username on page_generated events
Memind CI / Test, build, and release guards (pull_request) Successful in 5m34s
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:
@@ -123,6 +123,9 @@ export function sendMindSpaceAnalyticsEvent({
|
||||
const owner = resolveAnalyticsIdentity(ownerId, config);
|
||||
if (!owner) return Promise.resolve(false);
|
||||
const endpoint = `${String(config.analyticsUrl || 'http://127.0.0.1:3100').replace(/\/$/, '')}/api/send`;
|
||||
// Umami Memind dashboards resolve「创建用户」from event_data.username (not owner_label).
|
||||
// Keep owner_label for backward compatibility; never omit username on generation events.
|
||||
const username = resolveAnalyticsOwnerLabel({ displayName: ownerLabel });
|
||||
const payload = {
|
||||
website: config.websiteId,
|
||||
id: owner,
|
||||
@@ -137,7 +140,8 @@ export function sendMindSpaceAnalyticsEvent({
|
||||
channel,
|
||||
owner_segment: String(ownerSegment || 'unknown'),
|
||||
plan_type: String(planType || 'unknown'),
|
||||
owner_label: resolveAnalyticsOwnerLabel({ displayName: ownerLabel }),
|
||||
username,
|
||||
owner_label: username,
|
||||
generated_at: String(generatedAt || ''),
|
||||
identity_mode: config.identityMode === 'raw' ? 'raw' : 'pseudonymous',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user