src/index.html. Every screen of the app is served from that one file, so the script loads everywhere. Replace pk_xxxx with your project key.
src/index.html
Alternative: load it from a service
Use this version when you want to read the project key from your environment files. The service adds the script to the document head. It does nothing when the key is empty or when the script is already on the page.src/app/core/radar.service.ts
APP_INITIALIZER. Pick the tab that matches how your app is bootstrapped.
Keep the key out of development
With the service, store the key in your environment files and leave it empty for development. Without a key, the script is not added to the page, so Radar does not load while you develop.src/environments. Their names depend on how your project is set up: projects created with a recent Angular CLI use environment.development.ts for development and environment.ts for production. Put the empty key in the development file.
Check that it works
Deploy your site, open the published version, load two pages and click a link. The first event should reach your Radar dashboard within a few seconds. If nothing arrives, follow check your installation. When the tag is added by JavaScript rather than written in the HTML, it does not show in the raw page source: look fortracker.js in the Elements panel of your browser’s developer tools instead.