Via index.html
The simplest approach: paste the script tag into yourpublic/index.html or index.html before the closing </body>:
index.html
Via component
Prefer loading it from your React tree? Add a small effect to your rootApp.tsx:
App.tsx
The empty dependency array ensures the script is injected once on mount (not on every re-render).
npm package
For Vite and other bundlers, install the package and callinit once from your root:
main.tsx
Verify
Deploy your app and open it in a browser. Check your OpenRevenue dashboard: a pageview should appear within seconds.OpenRevenue ignores
localhost automatically. Test on your deployed URL, not the dev server.