设备标签如何随用户 ID 场景变化
设备标签与用户标签独立运作。为防止客户数据在不同的用户 ID 场景中被意外覆盖,FlareLane 采用了以下策略。
新分配(null -> 用户 A)
Section titled “新分配(null -> 用户 A)”如果用户 A 不存在,当前设备上的所有标签也会复制到用户 A
// Before
Device (Anonymous){ tags: { "tag1": "1", "tag2": "2", "tag3": "3" }}
User A not exists// After .setUserId("User A")
Device (User A){ tags: { "tag1": "1", "tag2": "2", "tag3": "3" }}
User A{ tags: { "tag1": "1", "tag2": "2", "tag3": "3" }}如果用户 A 已存在,则只复制用户 A 尚未拥有的标签
// Before
Device (Anonymous){ tags: { "tag1": "1", "tag2": "2", "tag3": "3" }}
User A{ tags: { "tag1": "A", "tag2": "B", }}// After .setUserId("User A")
Device (User A){ tags: { "tag1": "A", "tag2": "B", "tag3": "3" }}
User A{ tags: { "tag1": "A", "tag2": "B", "tag3": "3" }}切换用户(用户 A -> 用户 B)
Section titled “切换用户(用户 A -> 用户 B)”如果用户 B 不存在,则不复制用户 A 的标签,全部重置
// Before
Device (User A){ tags: { "tag1": "1", "tag2": "2", "tag3": "3" }}
User B not exists// After .setUserId("User B")
Device (User B){ tags: {}}
User B{ tags: {}}如果用户 B 已存在,则全部切换为用户 B 的画像,不进行复制
// Before
Device (User A){ tags: { "tag1": "1", "tag2": "2", "tag3": "3" }}
User B{ tags: { "tag1": "A", }}// After .setUserId("User B")
Device (User B){ tags: { "tag1": "A" }}
User B{ tags: { "tag1": "A", }}清除分配(用户 A -> null)
Section titled “清除分配(用户 A -> null)”当前设备上的所有标签都会被重置
// Before
Device (User A){ tags: { "tag1": "1", "tag2": "2", "tag3": "3" }}// After .setUserId(null)
Device (Anonymous){ tags: {}}