Skip to content
Last updated on March 2, 2023
9 min read

Audiences is available in Beta on all plans

Select your framework below to view instructions on using the Vercel Analytics in your project.

To start tracking visitors and page views with Audiences, use the following steps:

On the Vercel dashboard, select your Project and then click the Analytics tab. From there, select the Audiences tab, and click Enable from the dialog.

Note: Enabling Audiences will add new routes (scoped at /_vercel/insights/*) after your next deployment.

Using the package manager of your choice, add the @vercel/analytics package to your project:

pnpm i @vercel/analytics

The Analytics component is a wrapper around the tracking script, offering more seamless integration with Next.js.

If you are using the pages directory, add the following component to your main app dd file:

pages/_app.tsx
import type { AppProps } from 'next/app';
import { Analytics } from '@vercel/analytics/react';
 
function MyApp({ Component, pageProps }: AppProps) {
  return (
    <>
      <Component {...pageProps} />
      <Analytics />
    </>
  );
}
 
export default MyApp;

You can deploy your app to Vercel's global Edge Network by running the following command from your terminal:

terminal
vercel deploy

Once your app is deployed, it's ready to begin tracking visitors and page views.