Rove

Next.js analytics

Product analytics that fit the App Router.

Rove is analytics for Next.js. Install @rovestudio/web, keep the root layout a Server Component, and wrap children with a client RoveProvider. Page views — including client navigations — start on their own.

Server Components stay server

The provider is a small client wrapper. Your root layout does not have to become a Client Component.

Identify after the auth you have

Call rove.identify(userId) when the session is known. Call rove.reset() and rove.flush() on sign-out, before the redirect.

Same host as mobile

A Next.js marketing site and an Expo app can share a Rove workspace. Both POST to https://rovestats.com/api/v1/events.

Install

Install

npm install @rovestudio/web

Env

NEXT_PUBLIC_ROVE_KEY=rov_live_YOUR_WRITE_KEY
NEXT_PUBLIC_ROVE_HOST=https://rovestats.com

app/rove-provider.tsx

"use client";

import { RoveProvider } from "@rovestudio/web";

export function Rove({ children }: { children: React.ReactNode }) {
  return (
    <RoveProvider
      writeKey={process.env.NEXT_PUBLIC_ROVE_KEY!}
      host={process.env.NEXT_PUBLIC_ROVE_HOST!}
    >
      {children}
    </RoveProvider>
  );
}

Questions people ask

How do I add analytics to Next.js?

npm install @rovestudio/web, add NEXT_PUBLIC_ROVE_KEY and NEXT_PUBLIC_ROVE_HOST=https://rovestats.com, create a client RoveProvider wrapper, and wrap the root layout children. Get the write key from the Rove dashboard after you create a web app.

Does Rove track App Router client navigations?

Yes. RoveProvider hooks history so page_view fires on pushState and replaceState, not only on the first load.

Is Rove a replacement for Vercel Analytics?

Vercel Analytics is traffic and Web Vitals for a Vercel project. Rove is product analytics — people, visits, custom events, and a path across web and mobile.