General
Analytics
PostHog
Learn how to use the PostHog for tracking events.
To use PostHog, first create a PostHog account and copy your project key. If you chose the EU cloud, you also have to adjust the host URL.
Then change the environment variables in your dashboard and marketing .env
files:
.env
NEXT_PUBLIC_ANALYTICS_POSTHOG_KEY=NEXT_PUBLIC_ANALYTICS_POSTHOG_HOST=https://us.i.posthog.com
Change the provider in packages/analytics/provider/index.ts
:
packages/analytics/provider/index.ts
// export { default as AnalyticsProvider } from './console';// export { default as AnalyticsProvider } from './google-analytics';export { default as AnalyticsProvider } from './posthog';// export { default as AnalyticsProvider } from './umami';