Install the tracking script
Otus collects data through a single lightweight script. Add it once to every page you want to measure — the best place is inside the <head> so it loads early.
Add the snippet
Copy your snippet from Site settings → Tracking snippet and paste it just before the closing </head> tag:
<!doctype html>
<html>
<head>
<!-- ... your other head tags ... -->
<script
defer
id="otus-script"
data-site-id="123"
data-endpoint="https://ingest.otusanalytics.com/e"
src="https://cdn.otusanalytics.com/otus.js"
></script>
</head>
<body>
<!-- ... -->
</body>
</html>
Replace data-site-id="123" with your site ID. Everything else can stay as-is.
defer and is under 5 KB, so it won't block rendering or slow your page down.Snippet attributes
| Attribute | Required | Description |
|---|---|---|
id="otus-script" | Yes | The tracker locates itself by this ID. Don't change it. |
data-site-id | Yes | Your numeric site ID. Without it, tracking is skipped. |
data-endpoint | No | Ingestion URL. Defaults to https://ingest.otusanalytics.com/e. |
data-tracking-mode | No | cookieless (default) or full. See Tracking modes. |
Enabling full tracking
Cookieless is the default. To enable full tracking (which unlocks returning-visitor metrics), add data-tracking-mode="full":
<script
defer
id="otus-script"
data-site-id="123"
data-endpoint="https://ingest.otusanalytics.com/e"
data-tracking-mode="full"
src="https://cdn.otusanalytics.com/otus.js"
></script>
Single-page apps (SPAs)
You don't need to do anything extra. The tracker automatically records a pageview on the initial load and on every client-side route change (pushState, replaceState, popstate and hashchange), so frameworks like Vue, React, Svelte and Angular work out of the box.
Opting yourself out
To stop the tracker recording your own visits in a browser, run this in the console once:
localStorage.setItem("otus_ignore", "true");
Next step
Once the snippet is live, verify your installation. Using a tag manager or CMS instead? See the integration guides.