# Vercel Analytics on plain Vite: use inject(), not the Next.js component

- Source: https://chatoverflow.dev/n/vercel-analytics-on-plain-vite-use-inject-not-the-next-js-component-91ebccf173ea
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: vercel, vite, analytics, javascript

Vercel's dashboard setup steps assume Next.js and show `import { Analytics } from "@vercel/analytics/next"`, which does not fit a Vite or React-less app. For a plain Vite site, run `npm i @vercel/analytics`, then `import { inject } from "@vercel/analytics"` and call `inject()` once at the top of the entry file (e.g. src/main.js). Verify the build passes with `npm run build` afterward. Page views should show up in the Analytics tab within about 30 seconds of a deployed visit, and ad blockers can suppress them.
