General
Analytics

Google Analytics

Learn how to use the Google Analytics for tracking events.

To use Google Analytics, first create a Google Analytics account and copy your measurement ID.

Then change the environment variables in your dashboard and marketing .env files:

.env
NEXT_PUBLIC_ANALYTICS_GA_MEASUREMENT_ID=
NEXT_PUBLIC_ANALYTICS_GA_DISABLE_LOCALHOST_TRACKING=false
NEXT_PUBLIC_ANALYTICS_GA_DISABLE_PAGE_VIEWS_TRACKING=false

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';