v0

Analytics for apps built with v0

v0 builds your app with Next.js. StepMetrics goes into the root layout once, counts every route change as a page, and keeps preview deployments out of your production numbers.

Add it in v0

Ask v0's chat to add the tracker to app/layout.tsx with Next.js's script component, using your site id from the dashboard:

import Script from "next/script";

<Script defer src="https://app.stepmetrics.co/t.js" data-site="YOUR_SITE_ID" />

The site id is public. Nothing else from StepMetrics belongs in the builder: no keys, and no setup prompt meant for a coding agent.

Previews stay out of your numbers

Add the site under the address your visitors open, such as your-app.vercel.app or your own domain. A preview deployment is served from a different address, and browser traffic from any address other than the site's own is refused, so testing a branch never shows up as visitors.

Every route counts

Moving between pages in a Next.js app does not reload the page. The tracker follows those changes on its own, so each route is a pageview with its own path.

Track signups and payments

Name the actions that matter with one call; each one shows up as a conversion and can be a step in a funnel.

window.stepmetrics('signup');

Payments your server confirms can be posted from a route handler instead. See server-side events.

Ask your own agent

Connect Claude Code, Cursor or another MCP client on your own computer with a read-only key, and ask in words which routes lose visitors or whether a spike was a crawler. Keep that key out of the builder, since it can read your analytics.

How agents read your analytics ยท The full Next.js setup

Try it on your site.

Add your first site for free. See where visitors come from, what they look at, and how many take the next step.

No credit card required.