Disable posthog in widgets (#726)
Co-authored-by: Timo K <timok@element.io> Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
72503d0335
commit
123763afec
2 changed files with 6 additions and 3 deletions
|
@ -113,7 +113,11 @@ export class PosthogAnalytics {
|
||||||
project_api_key: Config.instance.config.posthog?.api_key,
|
project_api_key: Config.instance.config.posthog?.api_key,
|
||||||
api_host: Config.instance.config.posthog?.api_host,
|
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, {
|
this.posthog.init(posthogConfig.project_api_key, {
|
||||||
api_host: posthogConfig.api_host,
|
api_host: posthogConfig.api_host,
|
||||||
autocapture: false,
|
autocapture: false,
|
||||||
|
|
|
@ -96,8 +96,7 @@ export class SignupTracker {
|
||||||
track() {
|
track() {
|
||||||
PosthogAnalytics.instance.trackEvent<Signup>({
|
PosthogAnalytics.instance.trackEvent<Signup>({
|
||||||
eventName: "Signup",
|
eventName: "Signup",
|
||||||
signupDuration:
|
signupDuration: Date.now() - this.cache.signupStart.getTime(),
|
||||||
new Date().getSeconds() - this.cache.signupStart.getSeconds(),
|
|
||||||
});
|
});
|
||||||
PosthogAnalytics.instance.setRegistrationType(RegistrationType.Registered);
|
PosthogAnalytics.instance.setRegistrationType(RegistrationType.Registered);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue