From aae287e6e86c1bf61698caa379174c254622d35a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 10 Nov 2021 19:40:55 +0100 Subject: [PATCH] track pageviews in PH, add job role and company size into intercom --- packages/builder/src/analytics/PosthogClient.js | 2 +- packages/builder/src/stores/portal/auth.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/analytics/PosthogClient.js b/packages/builder/src/analytics/PosthogClient.js index 0a1fde42ea..ab06fa6413 100644 --- a/packages/builder/src/analytics/PosthogClient.js +++ b/packages/builder/src/analytics/PosthogClient.js @@ -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" }) diff --git a/packages/builder/src/stores/portal/auth.js b/packages/builder/src/stores/portal/auth.js index 2f558c88b2..6be2c7decf 100644 --- a/packages/builder/src/stores/portal/auth.js +++ b/packages/builder/src/stores/portal/auth.js @@ -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, }) }) }