fix(analytics): keep readable owner labels server-side

This commit is contained in:
john
2026-07-16 21:09:20 +08:00
parent 320945a485
commit 1f7b288a21
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -49,6 +49,7 @@ test('injects one local same-origin tracker with page dimensions', () => {
const html = '<!doctype html><html><head><title>Demo</title></head><body><h1>Demo</h1></body></html>';
const out = injectMindSpaceAnalytics(html, {
ownerId: 'user-123',
ownerLabel: '张三',
pageId: 'page-1',
publicationId: 'pub-1',
config: {
@@ -65,7 +66,8 @@ test('injects one local same-origin tracker with page dimensions', () => {
assert.match(out, /data-auto-track="false"/);
assert.match(out, /page_id/);
assert.match(out, /owner_segment/);
assert.match(out, /owner_label/);
assert.doesNotMatch(out, /owner_label/);
assert.doesNotMatch(out, /张三/);
assert.match(out, /page_click/);
assert.match(out, /page_form_submit/);
assert.match(out, /page_scroll_/);