Next.js Discord

Discord Forum

Analytics

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
Hey im using the @vercel/analytics package and i wanted to know if there is a way to get the anaylitcs in my local project too. I want to show how many people visited my page.

6 Replies

Use another analytics solution
I think there's other open source selfhostiable ones too
@Asiatic Lion Hey im using the @vercel/analytics package and i wanted to know if there is a way to get the anaylitcs in my local project too. I want to show how many people visited my page.
Actually, take a look at https://nextjs.org/docs/app/building-your-application/optimizing/analytics

You can pretty easily make your own:
'use client'
 
import { useReportWebVitals } from 'next/web-vitals'
 
export function WebVitals() {
  useReportWebVitals((metric) => {
    console.log(metric)
  })
}
@Asiatic Lion Cool, thanks
mind marking as solution?