Skip to main content

Via index.html

The quickest way: add the script to src/index.html before </body>:
src/index.html

Via service

For more control, inject the tracker from your root AppComponent:
src/app/app.component.ts
The isPlatformBrowser guard makes this SSR-safe if you use Angular Universal.

Verify

Deploy and open your app in a browser. Check your OpenRevenue dashboard: a pageview should appear within seconds.
OpenRevenue ignores localhost automatically. Test on your deployed URL.