
Vercel Web Analytics
Vercel’s built-in analytics tool offers detailed insights into your website’s visitors with new metrics like top pages, top referrers, and demographics.-
Add environment variables
.env.local
-
Enable it from the Vercel dashboard
If everything is set up properly, you should be able to see a Fetch/XHR request in your browser’s Network tab from
/_vercel/insights/view
when you visit any page.If you see _vercel/insights/script.js
404, make sure you have enable it from the Vercel dashboard. Otherwise vercel will keep trying to re-request that js file, which will consume a lot of vercel requests.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, simply add aNEXT_PUBLIC_GA_MEASUREMENT_ID
environment variable to your project.
Plausible
Plausible.io is a simple, privacy-first alternative to Google Analytics. To enable it, simply addNEXT_PUBLIC_PLAUSIBLE_SITE_SRC
and NEXT_PUBLIC_PLAUSIBLE_SITE_DOMAIN
environment variable to your project.
Umami
Umami is a open source web analytics tool. It is a simple, self-hosted alternative to Google Analytics. It is privacy-friendly and does not use cookies. It is also fast and lightweight. To enable it, simply addNEXT_PUBLIC_UMAMI_SITE_ID
and NEXT_PUBLIC_UMAMI_SITE_SRC
environment variable to your project.
PostHog
PostHog is a single platform to analyze, test, observe, and deploy new features. PostHog is a single platform to analyze, test, observe, and deploy new features. It comes with lots of products, including a web analytics tool, event analytics, feature flagging, and more. PostHog’s web analytics tool is enabled by default and captures pageviews, pageleave and custom events. To enable it, simply addNEXT_PUBLIC_POSTHOG_KEY
and NEXT_PUBLIC_POSTHOG_HOST
environment variable to your project.