Skip to content

feat(docs): add @vercel/analytics to docs and demo site - #261

Merged
michaeljymsgutierrez merged 1 commit into
mainfrom
feat/vercel-analytics
Nov 18, 2026
Merged

michaeljymsgutierrez merged 1 commit into
mainfrom
feat/vercel-analytics

Conversation

@michaeljymsgutierrez

Copy link
Copy Markdown
Owner

Description

Enables Vercel Web Analytics on apps/docs, which hosts both the Nextra docs site and the demo site as two separate route groups inside the same Next.js app. Mounts Vercel's <Analytics /> component so both route groups report page views once Web Analytics is turned on for the arm-js-library-docs Vercel project.

Github Issue: No tracking issue - direct request from Chael.

Changes

  • Added @vercel/analytics (^2.0.1) as a dependency in apps/docs/package.json, with the matching lockfile entries in apps/docs/yarn.lock.
  • Imported Analytics from @vercel/analytics/next and rendered <Analytics /> inside <body> in apps/docs/app/(docs)/layout.jsx (the docs site's root layout).
  • Imported Analytics from @vercel/analytics/next and rendered <Analytics /> inside <body> in apps/docs/app/demo/layout.jsx (the demo site's root layout) - mounted separately here because this layout does not inherit from the docs layout; each route group renders its own <html>/<body>.

Screenshots/Images

No visible UI change - <Analytics /> renders no markup, it only injects a tracking script.

How Has This Been Tested?

  • No automated tests added - this change has no testable application logic, only a dependency install and a component mount.
  • yarn build run locally in apps/docs: compiled all 79 pages with no errors, and the postbuild pagefind step reindexed 56 pages successfully.
  • Not yet verified at runtime in a browser or against a live Vercel deployment - see Reviewer Guidance.

Checklist

  • Code follows the project's coding standards and best practices.
  • No new tests were added; none were needed for a dependency install plus a component mount.
  • Documentation was not changed; none was needed for this change.
  • The PR is assigned to the correct reviewers.

Reviewer Guidance

  1. Open the preview link's docs home page (/). Open the browser DevTools Network tab and reload the page. Expected: a Vercel Analytics script request loads successfully (no 404/500), and the console shows no new runtime errors.
  2. Navigate to the preview link's demo home page (/demo). Repeat step 1's Network/console check on this page. Expected: same as step 1 - the demo layout mounts its own <Analytics /> instance since it does not share the docs layout.
  3. Web Analytics is off by default for an existing Vercel project - before this PR can report real data, enable "Web Analytics" in the Vercel dashboard for the arm-js-library-docs project (Project Settings -> Analytics). This is a one-time dashboard step outside this diff.

@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
arm-js-library-docs Ready Ready Preview Nov 18, 2026 3:37pm UTC

@michaeljymsgutierrez michaeljymsgutierrez self-assigned this Nov 18, 2026
@michaeljymsgutierrez
michaeljymsgutierrez marked this pull request as ready for review November 18, 2026 15:39
@michaeljymsgutierrez
michaeljymsgutierrez merged commit dbac6d0 into main Nov 18, 2026
4 checks passed
@michaeljymsgutierrez
michaeljymsgutierrez deleted the feat/vercel-analytics branch November 18, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant