for next.js teams
Tracking for Next.js apps, outside the repo.
Manage pixels for a Next.js app outside the codebase: route-change page views, load strategies, and alerts when a merge breaks tracking.
the problem
What goes wrong today.
Client-side navigation skips page views.
App Router navigations don't reload the page, so a pixel that only fires on load counts the first page and misses the rest.
Scripts in layout.tsx are one merge away from gone.
Tracking snippets in the root layout get dropped in conflict resolutions and refactors, and nothing fails a build when they do.
Load order is a race.
A purchase event that fires before the order total is ready sends a value of zero. Async scripts don't guarantee order.
with tracerkit
How it fits.
One script tag in the root layout.
Add the loader once to the head in app/layout.tsx. Every tag after that lives in the dashboard, not in your components.
Route-change triggers.
Fire tags on App Router navigations as well as hard loads, so page views match what visitors actually saw.
Next.js load strategies per tag.
Pick beforeInteractive, afterInteractive or lazyOnload per tag, the same vocabulary as next/script.
A typed data layer and SDK.
Push e-commerce events onto window.tracerkitLayer, or use the typed JS and React SDK for pushEvent, pushPurchase, identify and consent.
where to go next
questions
Asked and answered.
Should I use next/script for the loader?+
A plain script tag in the head of app/layout.tsx works, as does next/script with strategy="beforeInteractive". The install guide covers both.
Will it double count page views on navigation?+
Tags set to fire on route change fire once per navigation; tags set to page load fire once per hard load. Choose per tag.
Does the loader affect Core Web Vitals?+
The loader is small, async, and reads its config from the edge. Each tag's load strategy is yours to set, so heavy scripts can wait for idle.
tracerkit for
Stop guessing whether your tracking works.
Tag management is free forever. Paid tiers start with a 14-day trial, no card.