Add the script
Copy your project ID from Settings → General, then add the tracker to the right file for your router.App Router
Add the script to your rootapp/layout.tsx:
app/layout.tsx
Pages Router
Add the script to yourpages/_app.tsx:
pages/_app.tsx
npm package
Prefer a package? Installopenrevenue and use the thin OpenRevenueScript helper (still loads the CDN tracker), or call init from a client component.
app/layout.tsx
components/analytics.tsx
Verify
Deploy your app and visit any page. A pageview should appear in your OpenRevenue dashboard within seconds.OpenRevenue ignores
localhost and 127.0.0.1 automatically. Open your live site, not the dev server.