<head> and mark it is:inline. That tells Astro to leave the third-party script exactly as written instead of bundling it, so it loads on every page that uses the layout.
Before you start
- A tinyanalytics site. If you don’t have one yet, follow the Quickstart.
- Your snippet from Settings → Tracking in your dashboard.
Add the snippet to a shared layout
Add the tag to the<head> of the layout your pages share, for example src/layouts/Layout.astro:
src/layouts/Layout.astro
Single-page navigation
Most Astro sites serve real page loads, which are tracked with no extra setup. If you use Astro’s client-side View Transitions for in-app navigation, tinyanalytics records those route changes as pageviews by default (data-track-spa).
Verify
Build or deploy your site, open it in a browser, then check Realtime in your dashboard for your visit. See Verify your setup for the full check.Your install is working when your own visit appears in Realtime in your dashboard.
Related
Install on any platform
The universal method and other platforms.
Configure the tracking script
Every
data-* option you can set.Track custom events
Measure signups, clicks, and downloads.
Verify your setup
Confirm tracking works.