Vercel Analytics
Learn how to use Vercel Analytics for real-time traffic data.
The starter kit already renders Vercel Web Analytics from the root layout. You only need to enable the service for your Vercel project and deploy the application.
What is already configured
The repository includes @vercel/analytics and renders its Next.js component in app/layout.tsx:
import { Analytics } from '@vercel/analytics/next';
// Inside the root layout body
<Analytics />;This records page views after Web Analytics is enabled. It does not require an environment variable.
Enable Web Analytics
- Open your project in the Vercel dashboard.
- Select Analytics in the project sidebar.
- Enable Web Analytics.
- Deploy the application again so Vercel can add the analytics routes to the deployment.
- Visit the deployed application, then return to the Analytics dashboard to confirm that data arrives.
Dashboard activation is required The package and component are already present, but they do not replace enabling Web Analytics for the Vercel project.
Track a product event
Automatic page views answer traffic questions. Add custom events only for product actions that matter, such as completing onboarding or starting checkout:
'use client';
import { track } from '@vercel/analytics';
export function CheckoutButton() {
return (
<button
onClick={() =>
track('checkout_started', {
location: 'pricing'
})
}
>
Continue to checkout
</button>
);
}Do not send email addresses, names or other personal data as event properties.
Verify the integration
If the dashboard remains empty:
- Confirm Web Analytics is enabled for the correct Vercel project.
- Confirm the deployment was created after activation.
- Visit the production deployment with tracking protection or ad blockers disabled.
- Check that requests to
/_vercel/insights/*are not blocked by a reverse proxy or Content Security Policy. - Confirm
app/layout.tsxstill renders<Analytics />.
Use Vercel's Web Analytics troubleshooting guide for provider-specific diagnostics.
Privacy and consent
Web Analytics is designed without cookies, but privacy obligations depend on your users, configuration and jurisdiction. Document the service in your privacy notice and review Vercel's privacy guidance before launch. Do not treat the default integration as a substitute for legal review.