diff --git a/src/PosthogAnalytics.ts b/src/PosthogAnalytics.ts index 2932f137..4da55e39 100644 --- a/src/PosthogAnalytics.ts +++ b/src/PosthogAnalytics.ts @@ -113,7 +113,11 @@ export class PosthogAnalytics { project_api_key: Config.instance.config.posthog?.api_key, api_host: Config.instance.config.posthog?.api_host, }; - if (posthogConfig.project_api_key && posthogConfig.api_host) { + if ( + posthogConfig.project_api_key && + posthogConfig.api_host && + PosthogAnalytics.getPlatformProperties().matrixBackend === "jssdk" + ) { this.posthog.init(posthogConfig.project_api_key, { api_host: posthogConfig.api_host, autocapture: false, diff --git a/src/PosthogEvents.ts b/src/PosthogEvents.ts index 5dacac9d..4fb6181d 100644 --- a/src/PosthogEvents.ts +++ b/src/PosthogEvents.ts @@ -96,8 +96,7 @@ export class SignupTracker { track() { PosthogAnalytics.instance.trackEvent({ eventName: "Signup", - signupDuration: - new Date().getSeconds() - this.cache.signupStart.getSeconds(), + signupDuration: Date.now() - this.cache.signupStart.getTime(), }); PosthogAnalytics.instance.setRegistrationType(RegistrationType.Registered); }