How do I install a visitor ID tag on Next.js Pages Router?

On Next.js Pages Router, your visitor identification tag goes in: Import Script from 'next/script' in pages/_app.js or pages/[route].js. The install itself takes minutes; the part that goes wrong on Next.js Pages Router is below.

Where the tag goes

  1. Import Script from 'next/script' in pages/_app.js or pages/[route].js.
  2. Paste your vendor’s tag snippet exactly as issued. Do not wrap it in extra script tags or reformat it.
  3. Publish or deploy, then verify (below) before trusting data.

What breaks visitor tracking on Next.js Pages Router?

Script component will only load once even if user navigates between pages; strategy 'worker' is not recommended for Pages Router.

How do you verify the tag fires?

Start dev server, navigate between pages, check that script only loads once in Network tab.

Then run through the labeled QA checklist before you rely on the numbers, and set expectations with the match-rate calculator — no vendor identifies every visitor.

All platform install guides