1 minute

Install Web-Tracking.eu on Astro

Add the script tag to your site's BaseHead component (or whichever shared layout your pages render their head from).

1

Find your head component

Most Astro starters include something like src/components/BaseHead.astro or render <head> directly inside src/layouts/Layout.astro. Open whichever your pages use.

2

Add the script tag

Inside the <head> add:

---
// BaseHead.astro
---
<script
  is:inline
  src="https://web-tracking.eu/t.js?site=YOUR_SITE_ID"
  defer
></script>

The is:inline directive prevents Astro from processing it as a TypeScript module — it stays a regular external script tag.

3

Replace the site ID

Change YOUR_SITE_ID to your dashboard ID. Rebuild and deploy.

Verify it's working

  1. Open your site in a private/incognito window.
  2. Visit any page on the site.
  3. Open the Web-Tracking.eu dashboard for this site.
  4. The Realtime view should show your visit within 5–10 seconds.

Having trouble?

  • No data showing: Confirm the script is in the page source (View Source > search web-tracking.eu/t.js).
  • Wrong site ID: Double-check the ID matches the one in your dashboard. IDs are case-sensitive.
  • Ad blocker: Web-Tracking.eu is privacy-friendly, but some aggressive blockers still hide it. Test in a fresh browser.
  • Caching: Many platforms cache the page HTML. Purge your cache after install.
  • Still stuck? Email hello@web-tracking.eu with your site URL.
← Back to install hub