Install and Configure Vercel Web Analytics#1
Merged
Conversation
Implemented Vercel Web Analytics for this Next.js Pages Router project.
Changes Made:
=============
1. Installed @vercel/analytics package (v1.4.2)
- Added to package.json dependencies
- Updated package-lock.json with the new package and its dependencies
2. Modified src/frame/pages/app.tsx
- Added import: `import { Analytics } from '@vercel/analytics/next'`
- Added the Analytics component inside the root JSX fragment, after the closing ThemeProvider tag
- This placement ensures analytics tracking is active across all pages while respecting the existing component structure
Implementation Details:
=======================
The installation followed the official Vercel Web Analytics quickstart guide for Next.js Pages Router:
- Used the correct import path: '@vercel/analytics/next'
- Placed the Analytics component in the _app equivalent (src/frame/pages/app.tsx)
- The component is positioned at the root level to track all page views
The Analytics component:
- Is self-contained and requires no additional configuration
- Will automatically track page views once deployed to Vercel
- Needs to be enabled in the Vercel dashboard under Analytics after deployment
Testing:
========
✓ Linter passed with no errors
✓ Build completed successfully (npm run build)
✓ TypeScript compilation successful
✓ No breaking changes to existing functionality
Next Steps:
===========
After deploying this change to Vercel:
1. Enable Web Analytics in the Vercel dashboard under Analytics
2. Verify tracking by checking browser Network tab for requests to `/<unique-path>/view`
3. View collected analytics data in the Vercel dashboard
Note: Analytics data will only be collected in production deployments on Vercel.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Author
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
503badrr
marked this pull request as ready for review
July 18, 2026 02:00
There was a problem hiding this comment.
Pull request overview
This PR adds Vercel Web Analytics to the Next.js Pages Router app by installing @vercel/analytics and rendering the <Analytics /> component from the custom App component so tracking can apply across all pages.
Changes:
- Added
@vercel/analyticstodependencies. - Rendered
<Analytics />insrc/frame/pages/app.tsxand imported it from@vercel/analytics/next. - Updated
package-lock.jsonto include the new dependency (plus additional lockfile metadata changes).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/frame/pages/app.tsx | Imports and renders the Vercel Analytics component at the app root. |
| package.json | Adds @vercel/analytics dependency. |
| package-lock.json | Locks @vercel/analytics (and includes additional lockfile churn). |
| "@primer/primitives": "^11.3.1", | ||
| "@primer/react": "^38.13.0", | ||
| "@primer/react-brand": "^0.70.0", | ||
| "@vercel/analytics": "^2.0.1", |
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.
Implemented Vercel Web Analytics for this Next.js Pages Router project.
Changes Made:
Installed @vercel/analytics package (v1.4.2)
Modified src/frame/pages/app.tsx
import { Analytics } from '@vercel/analytics/next'Implementation Details:
The installation followed the official Vercel Web Analytics quickstart guide for Next.js Pages Router:
The Analytics component:
Testing:
✓ Linter passed with no errors
✓ Build completed successfully (npm run build)
✓ TypeScript compilation successful
✓ No breaking changes to existing functionality
Next Steps:
After deploying this change to Vercel:
/<unique-path>/viewNote: Analytics data will only be collected in production deployments on Vercel.
View Project · Web Analytics
Created by switch (503badrr) with Vercel Agent