Posthog + Unternehmensanfrage

This commit is contained in:
2025-09-05 12:21:09 +02:00
parent 1be8b2e9bd
commit 69f3e1b14f
18 changed files with 1110 additions and 48 deletions

21
src/lib/posthog.ts Normal file
View File

@@ -0,0 +1,21 @@
import posthog from 'posthog-js'
const POSTHOG_API_KEY = import.meta.env.VITE_POSTHOG_API_KEY || 'phc_jIkj0hQSY670vRaUVjSRSDOqmLCDGkL6GJy44iqE84M'
export const initPostHog = () => {
if (typeof window !== 'undefined') {
posthog.init(POSTHOG_API_KEY, {
api_host: 'https://app.posthog.com',
person_profiles: 'identified_only',
capture_pageview: true,
capture_pageleave: true,
loaded: (posthog) => {
if (process.env.NODE_ENV === 'development') {
console.log('PostHog loaded successfully')
}
}
})
}
}
export { posthog }