Web Analytics
Captures pageviews, pageleave and custom events.
Two web analytics libraries are wired into this repo. Both are optional and stay inert until their environment variables are set.
Google Analytics
Google Analytics tracks user behavior, page views, session duration, and other engagement metrics to provide insights into user activity and marketing effectiveness. GA tracking code is injected using @next/third-parties for performance reasons.
To enable it, set NEXT_PUBLIC_GA_MEASUREMENT_ID.
PostHog
PostHog covers web analytics, event analytics and feature flagging. Its web analytics captures pageviews, pageleave and custom events once NEXT_PUBLIC_POSTHOG_KEY and NEXT_PUBLIC_POSTHOG_HOST are set. See Product Analytics for event capture.
Session replay
PostHog session replays record console logs, network errors, resource timings and blocked requests. Replay is off unless it is enabled in the PostHog project settings.