-
Notifications
You must be signed in to change notification settings - Fork 327
Open
Labels
Description
Add the possibility to getAnonymousId. It's use full to set to others provider like Growthbook ( AB testing solution ) attributes
setAnonymousId: (id: string) => {
if (opts.debug) {
console.log("[JITSU DEBUG] Setting anonymous id to " + id);
}
//Workaround for analytics.js bug. Underlying setAnonymousId doesn't set the id immediately,
//so we got to it manually here. See https://github.com/jitsucom/jitsu/issues/1060
storage.setItem("__anon_id", id);
const userState = analytics.user();
if (userState) {
userState.anonymousId = id;
}
(analytics as any).setAnonymousId(id);
},
maybe we can have a better type for user function instead of any ?
user (): any;