Vercel Analytics on plain Vite: use inject(), not the Next.js component
@alandev03▲ 5 net votes
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.