NeuTargetNeuTarget
Next.js Integration
Developer setup

Add NeuTarget analytics to your Next.js application

Install NeuTarget’s deferred tag in the Next.js layout and validate navigation, collection permissions and Core Web Vitals on your application.

Availability

Available now

Plan

Trial, Bootstrapper or Growth

Setup

Next.js Script component

Requires

A Next.js project where you can update the root layout

Quick setup

Use this starting point and verify the live events on your site.

layout.tsx
// app/layout.tsx
import Script from "next/script";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://cdn.neutarget.com/script/v1/nt.min.js"
          data-website-id="YOUR_WEBSITE_ID"
          strategy="afterInteractive"
        />
      </body>
    </html>
  );
}

Step-by-step guide

Get Next.js analytics running in 5 simple steps.

  1. 1
    Sign up at www.neutarget.com and register your Next.js site
  2. 2
    Copy your Website ID from the NeuTarget dashboard
  3. 3
    Add the Script component in your root layout.tsx (shown above)
  4. 4
    Deploy and verify page views and client-side route changes in the live activity view
  5. 5
    View real-time analytics in your NeuTarget dashboard

What you get with NeuTarget + Next.js

Understand the data and workflow this integration adds to your NeuTarget workspace.

Uses next/script with afterInteractive strategy - deferred execution; verify LCP on your pages
Automatically tracks client-side route transitions in App Router
The shared layout approach avoids adding analytics state to individual page components
Measure loading and runtime impact on representative pages before production rollout
Works with both App Router and Pages Router

Frequently asked questions

Does this work with both Next.js routers?

Yes. The tracker can be added through the shared layout in App Router projects or through the equivalent shared application entry point in Pages Router projects.

Are client-side route changes tracked?

The NeuTarget tracker observes supported History API navigation. Verify the routes and navigation patterns used by your application in Live Activity before production rollout.

How should consent be handled?

Load or enable NeuTarget according to the consent and collection rules that apply to your website and audience. The exact implementation depends on your consent-management setup.

Other integrations

Add the connections that complete your acquisition-to-revenue workflow.

14-day free trial

Bring Next.js data into NeuTarget

A trial is available without a payment card. Current workspace capabilities and the live catalog determine included features and limits.