track pageviews in PH, add job role and company size into intercom

This commit is contained in:
Martin McKeaveney 2021-11-10 19:40:55 +01:00
parent 34e04e3837
commit aae287e6e8
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ export default class PosthogClient {
posthog.init(this.token, {
autocapture: false,
capture_pageview: false,
capture_pageview: true,
api_host: this.url,
})
posthog.set_config({ persistence: "cookie" })

View File

@ -57,11 +57,11 @@ export function createAuthStore() {
analytics.showChat({
email: user.email,
created_at: (user.createdAt || Date.now()) / 1000,
name: user.name,
name: user.account?.name,
user_id: user._id,
tenant: user.tenantId,
"Company size": user.size,
"Job role": user.profession,
"Company size": user.account?.size,
"Job role": user.account?.profession,
})
})
}