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