Repository navigation
feat(web): add @vercel/analytics - #455
Merged
Merged
Conversation
Wire <Analytics /> from @vercel/analytics/next into the root layout so every page on the docs site (home, /docs, etc.) reports page views. The component is a client-side script that batches and sends hits; it is a no-op outside of Vercel's edge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Coverage report
Per-file thresholds: 100% on statements / branches / functions / lines (ADR 0002). Files with no branches render |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Wire the Vercel Web Analytics component into the docs site so every page (home, /docs, etc.) reports page views.
Changes
apps/web/package.json— adds@vercel/analytics@^2.0.1as a dependency of the web app.apps/web/src/app/layout.tsx— importsAnalyticsfrom@vercel/analytics/nextand renders<Analytics />inside the root<RootProvider>, after{children}. The component is a client-side script that batches and sends page-view hits. It is a no-op outside Vercel's edge.pnpm-lock.yaml— updated to lock the new dependency.Validation
pnpm --filter web type-checkclean.pnpm --filter web lintclean (only the three pre-existing warnings).pnpm --filter web buildclean (25 routes).The Analytics component is a no-op when not running on Vercel, so local
pnpm devand any non-Vercel deployments are unaffected.