📈(frontend) limit event tracking to stay within free tier limits

Optimize event tracking to be frugal and reduce event volume,
even though filtering can be done later if needed.
This commit is contained in:
lebaudantoine
2024-09-17 13:05:56 +02:00
committed by aleb_the_flash
parent b9bcc45cce
commit 0ad9b7e233

View File

@@ -19,14 +19,18 @@ function App() {
const { i18n } = useTranslation()
useLang(i18n.language)
posthog.init('phc_RPYko028Oqtj0c9exLIWwrlrjLxSdxT0ntW0Lam4iom', {
api_host: 'https://eu.i.posthog.com',
person_profiles: 'always',
})
const isProduction = import.meta.env.PROD
silenceLiveKitLogs(isProduction)
// We're on a free tier, so we need to limit the number of events we send to PostHog.
// Be frugal with event tracking, even though we could filter them out later if necessary.
if (isProduction) {
posthog.init('phc_RPYko028Oqtj0c9exLIWwrlrjLxSdxT0ntW0Lam4iom', {
api_host: 'https://eu.i.posthog.com',
person_profiles: 'always',
})
}
return (
<QueryClientProvider client={queryClient}>
<Suspense fallback={null}>