|
|
|
@ -54,18 +54,25 @@ export function createAuthStore() { |
|
|
|
}) |
|
|
|
|
|
|
|
if (user) { |
|
|
|
analytics.activate().then(() => { |
|
|
|
analytics.identify(user._id, user) |
|
|
|
analytics.showChat({ |
|
|
|
email: user.email, |
|
|
|
created_at: (user.createdAt || Date.now()) / 1000, |
|
|
|
name: user.account?.name, |
|
|
|
user_id: user._id, |
|
|
|
tenant: user.tenantId, |
|
|
|
"Company size": user.account?.size, |
|
|
|
"Job role": user.account?.profession, |
|
|
|
analytics |
|
|
|
.activate() |
|
|
|
.then(() => { |
|
|
|
analytics.identify(user._id, user) |
|
|
|
analytics.showChat({ |
|
|
|
email: user.email, |
|
|
|
created_at: (user.createdAt || Date.now()) / 1000, |
|
|
|
name: user.account?.name, |
|
|
|
user_id: user._id, |
|
|
|
tenant: user.tenantId, |
|
|
|
"Company size": user.account?.size, |
|
|
|
"Job role": user.account?.profession, |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
// This request may fail due to browser extensions blocking requests
|
|
|
|
// containing the word analytics, so we don't want to spam users with
|
|
|
|
// an error here.
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|