Install on Astro
Add Open Analytics to a Astro site: where the snippet goes and how to verify it.
The short way
From your project folder, let the CLI detect Astro and place the snippet itself:
npx getopen initIt asks for your tracking key, writes the tag, and prints which file it changed. It is idempotent, so running it on a project that already has the snippet leaves it alone. Prefer to do it by hand? The steps below are exactly what it does.
Add it to Astro
Add the snippet to the <head> of your base layout. Astro strips unknown attributes from components, not from plain script tags, so the tag works as-is; add is:inline if your setup processes scripts.
<script
async
src="https://c.getopen.so/oa.js"
data-key="YOUR_TRACKING_KEY"
data-collector="https://c.getopen.so"
></script>Deploy and open the site at the address you gave the dashboard. The realtime view shows the visit within seconds; historical charts fill moments later. Loading it on your dev server first still tells you something: the dashboard's waiting screen names the host it saw the tag load on, and the tracker writes one line in the browser console when that host is not one the site counts. Visits themselves are only counted from the site's own domain, because localhost cannot be listed: deploy to see data, or empty the allowed domains list in Settings while you install. Nothing arriving? The troubleshooting page walks through the usual reasons.
Where to next
Track custom events
Count the clicks, signups and checkouts that matter, by attribute, a no-code rule, or the JavaScript API.
Script options
Test mode, debug logging, strict storage and the privacy attributes the snippet accepts.