Install the tracker
The Satsu tracker is a single <script> tag — under 3 KB, no SDK, no build
step. Add it once and pageviews, referrers, devices and countries start flowing
in seconds.
<script defer src="https://track.satsu.pro/tracker.js" data-site="YOUR_ID"></script>Replace YOUR_ID with your site's ID (find it in the dashboard under Sites →
your site → install). That's the entire integration — everything below is just
where to put it in your framework.
Attributes
| Attribute | Required | What it does |
|---|---|---|
data-site | Yes | Your site ID. Without it the tracker does nothing. |
data-api | No | Override the ingest endpoint. Defaults to the script's own origin + /e, so you normally never set this. |
By framework
Plain HTML
Put it in the <head> of your page:
<!doctype html>
<html>
<head>
<script defer src="https://track.satsu.pro/tracker.js" data-site="YOUR_ID"></script>
</head>
<body>...</body>
</html>Next.js (App Router)
Add it to app/layout.tsx with next/script:
import Script from "next/script";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{children}
<Script
defer
src="https://track.satsu.pro/tracker.js"
data-site="YOUR_ID"
/>
</body>
</html>
);
}React (Vite / CRA)
Add the tag to index.html:
<head>
<script defer src="https://track.satsu.pro/tracker.js" data-site="YOUR_ID"></script>
</head>Vue / Nuxt
In nuxt.config.ts:
export default defineNuxtConfig({
app: {
head: {
script: [
{ src: "https://track.satsu.pro/tracker.js", defer: true, "data-site": "YOUR_ID" },
],
},
},
});Astro
In your base layout's <head>:
---
// src/layouts/Base.astro
---
<head>
<script defer src="https://track.satsu.pro/tracker.js" data-site="YOUR_ID"></script>
</head>Single-page apps
The tracker handles client-side routing automatically. It hooks pushState,
replaceState and popstate, so every route change is counted as a pageview
— no router integration or manual calls needed. Repeated navigations to the same
path are de-duplicated.
Building with an AI assistant?
Paste the script tag into your layout's <head> — that's the whole thing. No
package to install, no config, no client library.
What's tracked automatically
Once installed, with no extra code, Satsu records pageviews, SPA route changes, outbound link clicks, file downloads and scroll depth. See What we track for the full list, or Custom events to track your own.
Next: Verify it works →