Analytics built for Next.js

OpenPanel ships a Next.js SDK that fits how Next.js works: one component in the root layout, route changes tracked in the App Router and the Pages Router, server-side events from Route Handlers and Server Actions, and a proxy route so ad blockers do not eat your data. Events, funnels and profiles that work with SSR.

The problem

Why standard analytics breaks in Next.js

Next.js is not a traditional website. Most analytics tools were built before App Router existed and show it.

  • GA4 breaks with App Router route changesGoogle Analytics was designed for traditional page loads. In Next.js App Router, client-side navigation doesn't trigger GA4's page view events unless you add custom workarounds. Your analytics misses a significant portion of page views.
  • Cookie consent is painful in Next.jsImplementing a GDPR-compliant cookie consent flow in a Next.js app requires next/script, consent state management, and conditional script loading. It's a non-trivial engineering task just to run analytics.
  • No server-side trackingMost analytics SDKs are client-only. Server-side events, API route completions, background jobs, server actions, are invisible. You're missing half the picture.
  • Analytics libraries bloat your bundleMany analytics SDKs add 20 to 50 KB to your JavaScript bundle. In a performance-conscious Next.js app that shows up in Core Web Vitals.
Next.js

One component in your layout

The Next.js package wraps the web tracker for the App Router and the Pages Router, tracks route changes, and exposes a server-side client for events from route handlers and server actions.

App Router and Pages Router
Drop the component into the root layout and route changes are screen views.
Server-side too
Send events from route handlers with the Node SDK and the client secret.
Typed
TypeScript types for every call and every option.
Product analytics

Where people drop off, and who comes back

Funnels, retention, cohorts and profiles on the events you already send. Every report is in every plan; you pay for events, not for the people who look at them.

Funnels and conversion
Session or profile based, broken down by any property or cohort.
Retention and cohorts
A cohort grid with an average that skips weeks that have not happened yet.
Profiles and groups
Every user with sessions, events and revenue, and the company they belong to.
Privacy

No cookies, so no banner

A visitor is a daily-rotating hash of user agent, IP and site. Nothing is stored in the browser, Cloud data stays in the EU, and the tracker is a few kilobytes.

Cookie-less by default
No consent banner for analytics. The salt changes every day.
EU cloud
Hosted in Germany, with a GDPR data processing agreement.
Light SDK
About 3 KB gzipped. Replay loads separately, only if you turn it on.
What you get

Analytics that works the way Next.js works

OpenPanel's Next.js SDK is a thin layer over the web SDK and the Node SDK, so it fits modern Next.js patterns without a client-only afterthought.

  • Next.js SDK with App Router supportInstall @openpanel/nextjs, add <OpenPanelComponent clientId="…" trackScreenViews /> to your root layout, and page views are tracked in the App Router and the Pages Router.
  • Automatic route change trackingEvery router.push(), <Link> navigation and back or forward action becomes a screen_view. The SDK hooks pushState, replaceState and popstate; no useEffect or router listeners needed.
  • Server-side event trackingCreate an OpenPanel instance with your client id and secret in a Route Handler, Server Action or background job and call track(), identify() or revenue(). Payments and jobs land in the same project as the client events.
  • Proxy through your own domainExport createRouteHandler from @openpanel/nextjs/server in an API route and the script and events go through your domain. Ad blockers that block third-party analytics hosts no longer drop your data.
  • Cookieless by defaultNo cookies, no localStorage, so no consent manager, no conditional script loading and no next/script gymnastics. Install and track.
  • Identify users across sessionsCall identify({ profileId, email, firstName }) after sign-in, or pass profileId to the component when you have it on the server. Works with NextAuth.js, Clerk or your own auth.
  • TypeScript SDKThe SDK is written in TypeScript with full types for every method, hook and component.
  • 3 KB client scriptThe tracker is about 3 KB gzipped and loads async after your page. Session replay is a separate module that loads only when enabled.
Why OpenPanel

Why Next.js developers choose OpenPanel

OpenPanel fits naturally into a modern Next.js codebase, not as an afterthought.

  • Works exactly how Next.js worksOne component for the client, the Node SDK for the server, a route handler for the proxy. Built on the same SDKs, not bolted onto a client-only library.
  • No consent infrastructure neededCookieless tracking means no consent modal, no next/script loading gymnastics, no conditional initialization. Install once, works everywhere.
  • Track server and client events in the same dashboardServer Actions, Route Handlers and client interactions show up together, on the same profiles and in the same funnels.
  • Open source and self-hostableRun OpenPanel on your own infrastructure. Your Next.js app's analytics data never leaves your servers.
  • From $2.50/monthNo enterprise contract, no per-seat fees. Pay for events, get every feature. 30-day free trial on Cloud, free to self-host.

Frequently asked questions

Common questions from Next.js developers evaluating OpenPanel.

Start understanding your users today

One script on your site, or one SDK call in your app, and the first events show up within a minute. 30-day free trial, no credit card.

Cloud from $2.50 a month, or self-host for free.