Add the tag
Put one script line in the head of every page. Where it goes in plain HTML, site builders and each framework.
Updated
The tag is one script line that counts your site's visits. Get it right once, in the shared layout, and every page is counted. Every project has its own line; copy it from Tracking, or let your agent take it from get_tag.
<script async src="https://t.nextanalytica.app/t.js" data-project="na_…"></script>na_… is your project's key. Never make one up: a line written from memory counts nothing.
Where does the tag go?
Put the line in the <head> of every page, once, in the layout every page shares.
| Your site | Where |
|---|---|
| Plain HTML | The <head> of every page, or of the shared template. |
| WordPress, Webflow, Framer, Shopify, Wix, Squarespace | The site's custom code for the head of every page. |
| Google Tag Manager | A Custom HTML tag with the line, triggered on All Pages. |
| Next.js (App Router) | app/layout.tsx, with next/script, inside <body>. |
| Next.js (Pages Router) | pages/_app.tsx, with next/script. |
| React, Vue or Svelte with Vite | index.html, inside <head>. |
| Nuxt | nuxt.config.ts, in app.head.script. |
| SvelteKit | src/app.html, inside <head>. |
| Astro | The shared layout's <head>, with is:inline. |
| Remix and React Router | app/root.tsx, inside <head>. |
For Next.js:
import Script from "next/script";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{children}
<Script src="https://t.nextanalytica.app/t.js" data-project="na_…" strategy="afterInteractive" />
</body>
</html>
);
}For Nuxt:
export default defineNuxtConfig({
app: { head: { script: [{ src: "https://t.nextanalytica.app/t.js", async: true, "data-project": "na_…" }] } },
});Single-page navigation is counted on its own, and the same line works on your subdomains.
How do you check it works?
Click Verify in Tracking. It opens your site; one visit with the tag proves the site is yours, and the domain turns live within about a minute. Visits are kept from then on, not before.