Skip to main content
Observe

Web Analytics

Count visitors, page views, and custom events with the unmodified @vercel/analytics package.

Web Analytics shows who visits your site and what they do: visitors, page views, bounce rate, top pages and routes, referrers, UTM parameters, countries, devices, browsers, operating systems, and custom events. It works with the @vercel/analytics package as it is. You don't change your code or set an endpoint.

Web Analytics doesn't use cookies. Easel counts a visitor with an anonymous hash of the project, IP address, and user agent, under a key that changes every day. The IP address isn't stored with your analytics, and the hash can't be matched across days or projects. Referrers are kept without their query string. Known crawlers and verified bots aren't counted.

Turn it on

Web Analytics is off until a workspace owner or admin turns it on for a project.

  1. Open the project and select Analytics.

  2. Select Enable.

  3. Install the package in your app:

    npm i @vercel/analytics
  4. Add the component. For the Next.js App Router, add it to app/layout.tsx:

    import { Analytics } from "@vercel/analytics/next";
    
    export default function RootLayout({ children }: { children: React.ReactNode }) {
      return (
        <html lang="en">
          <body>
            {children}
            <Analytics />
          </body>
        </html>
      );
    }

    Other frameworks use the same package: @vercel/analytics/react, @vercel/analytics/sveltekit, @vercel/analytics/nuxt, or inject() from @vercel/analytics.

  5. Deploy, then visit your site. Data shows up on the Analytics page within a minute.

Every build points the package at a path unique to your project instead of /_vercel/insights, so ad blockers that block Vercel Analytics don't drop your visitors.

To turn it off, open Settings > Analytics. Easel stops collecting, and the data you already collected stays.

Custom events

Custom events track actions that aren't page views, such as a sign-up or a purchase. Send them with track():

import { track } from "@vercel/analytics";

track("Sign Up", { plan: "pro" });

From server code, import track from @vercel/analytics/server and pass the request, so the event is attributed to the visitor:

import { track } from "@vercel/analytics/server";

export async function POST(request: Request) {
  await track("Checkout", { amount: 42 }, { request });
  return Response.json({ ok: true });
}

Event names and property values are limited to 255 characters. Properties must be strings, numbers, booleans, or null; nested objects are dropped. On the Analytics page, select an event to see the values of its properties.

Read the page

The Analytics page covers the environment and time range you pick at the top: production, preview, or both, over the last 24 hours or 7, 30, or 90 days.

SectionShows
OnlineVisitors active in the last five minutes
Visitors, Page Views, Bounce RateTotals with the change from the previous period of the same length, and a chart of the selected one
Pages, Routes, HostnamesWhere visitors went. Routes group dynamic pages, such as /blog/[slug].
Referrers, UTM ParametersWhere visitors came from
Countries, Devices, Browsers, Operating SystemsWho visitors are, as a share of visitors
EventsCustom events by visitors and total count

Select any row to filter the whole page by it. Filters stay in the page URL, so you can share a filtered view. A referrer or UTM filter shows the visitors who arrived that way, with every page they viewed after landing.

Bounce rate is the share of visitors who viewed one page.

Pricing

An event is a page view or a custom event.

PlanIncludedAfter that
Hobby50,000 events a monthCollection pauses until the next cycle. Your sites keep running.
ProNone$0.03 per 1,000 events

Your project's firewall rules and rate limits apply to Web Analytics requests, so you can block or limit traffic that would add events you don't want.

See Limits for retention.

Next steps