Update posthog config to disable unneeded stuff (#6986)

This commit is contained in:
Artem Kheystver 2024-10-21 09:04:37 +02:00 committed by GitHub
parent 11b6aa4820
commit 7190bacc0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,12 @@ import posthog from 'posthog-js'
export class PosthogAnalyticProvider implements AnalyticProvider {
init(config: Record<string, any>): boolean {
if (config.POSTHOG_API_KEY !== undefined && config.POSTHOG_API_KEY !== '' && config.POSTHOG_HOST !== null) {
posthog.init(config.POSTHOG_API_KEY, { api_host: config.POSTHOG_HOST })
posthog.init(config.POSTHOG_API_KEY, {
api_host: config.POSTHOG_HOST,
autocapture: false,
capture_pageview: false,
capture_pageleave: false
})
return true
}
return false