11ai Vercel Analytics
Set up Vercel Web Analytics with the project’s existing framework and package manager. Follow the official quickstart and keep the default integration minimal.
Read references/implementation.md before changing application code.
Workflow
- Inspect the framework, router, package manager, root application shell, existing analytics packages, and deployment configuration.
- Confirm whether
@vercel/analyticsand an Analytics component already exist. Keep exactly one root integration unless the application intentionally has isolated roots. - Add
@vercel/analyticswith the repository’s package manager. - Mount the framework-specific component at the root. For Next.js, import
Analyticsfrom@vercel/analytics/nextand use the App Router or Pages Router pattern from the reference. - Preserve providers, metadata, styling, and unrelated layout behavior.
- Run the project’s lint, typecheck, build, and relevant tests.
- Report the code change separately from Vercel project state. Do not claim analytics is active until Web Analytics is enabled in the Vercel dashboard and a deployment is receiving traffic.
Rules
- Prefer automatic environment detection and the default
<Analytics />configuration. - Do not add
mode,debug,beforeSend, custom endpoints, or custom events unless the user requests them or the project requires them. - Do not add Speed Insights when the request is only for Web Analytics.
- Do not duplicate the component in nested layouts or individual pages.
- Treat dashboard enablement and deployment as external actions. Perform them only when authorized and available.
- Verify deployed collection through the analytics network request and dashboard data; local rendering alone does not prove production collection.
Delivery
Report the installed package, integration file, verification commands, and any remaining dashboard or deployment step.