How to set up Vercel Analytics for your Next.js project.
Setting up Vercel Analytics is incredibly straightforward in Next.js.
1. Install the package:
```bash
npm install @vercel/analytics
```
2. Add the component to your layout:
```tsx
import { Analytics } from '@vercel/analytics/react';
export default function RootLayout({ children }) {
return (
{children}
);
}
```
Now you can track views and performance in your Vercel dashboard.
1. Install the package:
```bash
npm install @vercel/analytics
```
2. Add the component to your layout:
```tsx
import { Analytics } from '@vercel/analytics/react';
export default function RootLayout({ children }) {
return (
{children}
);
}
```
Now you can track views and performance in your Vercel dashboard.