Skip to content

Commit 7d00722

Browse files
authored
fix: initialize anonymous ID on load (#1674)
1 parent 3aa61b4 commit 7d00722

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/web/src/managers/user-manager/user-manager.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ export class UserManager {
3636
anonymousId?: string,
3737
) {
3838
if (userTrackingMode === 'anonymousTracking') {
39-
this.anonymousId = anonymousId
39+
if (anonymousId) {
40+
this.anonymousId = anonymousId
41+
this.persistAnonymousId(anonymousId)
42+
} else {
43+
this.getAnonymousIdIfEnabled()
44+
}
4045
}
4146
}
4247

0 commit comments

Comments
 (0)