New Post - Vercel Analytics
How to Add Vercel Web Analytics
This is the first blog post on this blogs so I'm going to keep the name "new-post".
The steps are listed clearly here but i figured I can list few steps to keep it short and concise.
Steps:
1. install the package.
npm i @vercel/analytics
2. Add Analytics
tsx
import { Analytics }
from'@vercel/analytics/react';
export default function RootLayout({ children,}: {
children:React.ReactNode;}) {
return (
<html lang="en">
<head> <title>Next.js</title></head>
<body> {children}
<Analytics /> {/* <-- here */ }
</body></html>
);}
3. Deploy! 🎉
Vercel screenshot
Thanks!