pk_xxxx with your project key. The is:inline directive tells Astro to leave the tag exactly as written.
src/layouts/BaseLayout.astro
Alternative: a tracker component
Move the script into its own component when you want to read the project key from an environment variable, or reuse it across several layouts. The component adds the script from the browser. It does nothing when the key is missing or when the script is already on the page.src/components/RadarTracker.astro
<head> of your layout:
src/layouts/BaseLayout.astro
Keep the key out of development
With the tracker component, store the key in an environment file 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.PUBLIC_ to code that runs in the browser.
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.