Skip to main content

Via layout

Add the script to your base layout file (e.g. src/layouts/Layout.astro):
src/layouts/Layout.astro
Use is:inline to prevent Astro from bundling the tracker; it should load as a plain external script.

Via Head tag

If you use Astro’s <head> directly in pages, add the script there:
src/pages/index.astro

Verify

Deploy and open your site in a browser. Your OpenRevenue dashboard should show a pageview within seconds.
OpenRevenue ignores localhost automatically. Test on your deployed URL.