Documentation

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:

index.htmlhtml
<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:

AttributeWhat it is
srcThe tracker file. The URL never changes and is cached for an hour; you never edit it to get a fix.
data-keyYour 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-collectorWhere events are sent. Set it explicitly so the tag works no matter which page it sits on.
asyncDeliberate. 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 tracker follows client-side navigation itself and counts route changes as pageviews, so React, Vue, Svelte and friends need the tag in one place, not per route.

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.

Terminal
npx getopen init

It is idempotent; a project that already carries the snippet is left alone. See the CLI page for everything else it can do.

Framework guides

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

DashboardSiteRealtime

The 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.