React framework

Analytics for Next.js

Add Muro analytics to any Next.js app with one Script tag. Works with App Router and Pages Router.

No credit card required. Takes 2 minutes.

Why analytics matter for Next.js sites

Next.js apps need analytics that respect Core Web Vitals and don't break SSR. Most heavy analytics tools mess up your Lighthouse score and add complexity to your layout. Muro is one tiny script, works with both App Router and Pages Router, and doesn't require any extra config to track client-side route changes.

How to add Muro to Next.js

Adding Muro to a Next.js app takes about two minutes. The setup is slightly different for App Router vs Pages Router, but both are simple:

01

Import the Script component

In your root layout (app/layout.tsx for App Router, pages/_app.tsx for Pages Router), import { Script } from 'next/script'.

02

Add the Muro script

Add <Script src="https://api.muroanalytics.com/muro.js" data-project-id="YOUR_KEY" strategy="beforeInteractive" /> inside the <head> of your layout.

03

Deploy

Deploy your Next.js app. Muro starts tracking pageviews automatically across all your routes, including client-side navigation.

Works with both App Router (Next.js 13+) and Pages Router. Plays nicely with Vercel Analytics, Speed Insights, and other observability tools.

What Muro tracks on Next.js

Once installed, Muro tracks the things that matter — automatically.

Pageviews across all routes (App Router and Pages Router)

Client-side route changes (SPA-style navigation)

Form submissions and conversion events

Traffic sources, devices, and countries

Custom events you fire from your components

Real situations where Muro helps Next.js users

These are the kinds of moments where a daily insight email beats a dashboard.

01

Your /blog index suddenly becomes your top entry point

Muro flags this kind of shift automatically. Often it means a specific post started ranking. You'll know which one without having to dig through Search Console.

02

You shipped a new landing page and want to know if it converts

Compare conversion rates between /old-landing and /new-landing. Muro tracks per-route conversions automatically, so you can A/B test without setting up an A/B testing tool.

03

A custom event in your React component is firing more than expected

Muro lets you track custom events with one line of JS. Useful for measuring feature usage, modal opens, or button clicks that don't trigger navigation.

What you'll actually get

Muro doesn't show you charts. It tells you what matters. Here's an example insight a Next.js site might receive.

Alert

Your blog index page is your top entry point this week

62% of new visitors landed on /blog this week, up from 28% last week. Looks like one post is driving search traffic. Worth checking which one and considering an upgrade or follow-up.

Tips for getting more out of Muro on Next.js

Quick wins from people who use Muro every day.

Use strategy="beforeInteractive" for the Muro script. It loads early enough to catch the first pageview but doesn't block your page.

App Router and Pages Router both work fine with Muro. If you're using App Router, put the Script tag in app/layout.tsx so it applies to every route.

To fire a custom event from any component, call window.muro?.track('event_name'). The optional chaining handles SSR safely.

Muro plays nice with Vercel Analytics and Speed Insights. They serve different purposes: Vercel for performance and pageviews, Muro for plain-language insights and conversion analysis.

If you're using next-intl or i18n, Muro tracks each locale's pageviews separately because the URLs differ.

Common questions about Muro on Next.js

Yes. Add the Script component to either app/layout.tsx (App Router) or pages/_app.tsx (Pages Router) and it works.

No. The script is under 5KB and loads asynchronously. Many Next.js sites use Muro with strategy="beforeInteractive" with no measurable LCP or CLS impact.

Yes. Muro complements Vercel's tools. Vercel Analytics shows pageviews and Web Vitals. Muro adds conversion tracking and plain-language insights.

Yes. Call window.muro?.track('event_name') from any component. Useful for tracking button clicks, modal opens, or feature usage that doesn't trigger navigation.

Try Muro on your Next.js site

Start your 30-day free trial. No credit card required.

$5/month after the trial. Cancel anytime.