Installing the tracker
The snippet, the CLI installer, where the tag goes, and how to confirm it works.
Two ways in
Installing Open Analytics is one script tag on your site. You can paste it yourself, or let the CLI find the right file and paste it for you. Either way the tag is the same, and once it is live your dashboard starts filling within seconds.
Paste the snippet
Copy one tag into your site's <head>. Best when you own the HTML or a shared layout.
Run the CLI
npx getopen init detects your framework and writes the tag into the right file for you.
The snippet
One tag in your site's <head>, on every page:
<script
async
src="https://c.getopen.so/oa.js"
data-key="YOUR_TRACKING_KEY"
data-collector="https://c.getopen.so"
></script>What each part is:
| Attribute | What it is |
|---|---|
src | The tracker file. The URL never changes and is cached for an hour; you never edit it to get a fix. |
data-key | Your site's tracking key, shown when you create the site and any time after under Settings → Installation. Public by design: write-only, an ingest identifier, never read access. |
data-collector | Where events are sent. Set it explicitly so the tag works no matter which page it sits on. |
async | Deliberate. The tracker records the first pageview immediately and folds in your site's configuration afterwards, so it never costs you a fast bounce. |
Single-page apps need it once
The CLI installer
npx getopen init does the paste for you: it detects the framework, asks for the tracking key, writes the snippet into the right file and tells you which file it changed.
npx getopen initIt is idempotent; a project that already carries the snippet is left alone. See the CLI page for everything else it can do.
Framework guides
The tag is the same everywhere; only the file it goes into changes. Pick your stack for the exact place and, for Next.js, the next/script way as well.
HTML / static sites
The snippet's home, plus the one-command CLI install.
Next.js
The snippet's home, plus the one-command CLI install.
TanStack Start
The snippet's home, plus the one-command CLI install.
React (Vite / CRA)
The snippet's home, plus the one-command CLI install.
Vue.js
The snippet's home, plus the one-command CLI install.
Nuxt
The snippet's home, plus the one-command CLI install.
SvelteKit
The snippet's home, plus the one-command CLI install.
Remix
The snippet's home, plus the one-command CLI install.
Astro
The snippet's home, plus the one-command CLI install.
Gatsby
The snippet's home, plus the one-command CLI install.
WordPress
The snippet's home, plus the one-command CLI install.
Webflow
Where the snippet goes on this platform, step by step.
Shopify
Where the snippet goes on this platform, step by step.
Confirm it works
Open your site once
Deploy and load any page at the address you gave the dashboard. That first visit is all the tracker needs. A dev server is worth a load too, and it will tell you the tag is there — the waiting screen names the host it saw, and the tracker writes one line in the console when that host is not one this site counts — but visits are only counted from the site's own domain, so the numbers come from the deployed site.
Watch it arrive in realtime
DashboardSiteRealtimeThe realtime view is the fastest signal: the visit appears within seconds. Historical charts pass through the batch pipeline and typically land in about two seconds.
The install step flips itself
The dashboard's install step turns to done on its own the moment the first event arrives, so you never have to confirm by hand.
The origin allowlist
Configured domains narrow what is accepted
If your site has domains set in Settings, events are accepted only from those hosts. An empty domain list means unconfigured, which accepts any origin; it never means deny all.
Adding your first domain silently narrows what is accepted, so if you test from a staging host, add it too.
Updates
The script URL never changes and the file is cached for one hour. You never edit the snippet to get a fix; improvements reach your visitors within an hour of us shipping them.