Getting started
Install the tracker
One script tag in the <head>. It is about 2 KB gzipped, loads deferred, and never blocks rendering.
The script tag
Find your site ID in Settings, then add:
<script defer src="https://t.thunderstats.com/ts.js" data-site-id="YOUR_SITE_ID"></script>
Pageviews are sent on load and on every pushState / replaceState / popstate, so single-page apps work without extra configuration.
Optional auto-tracking
Add these attributes to the same script tag to collect more without writing code.
| Attribute | What it does |
|---|---|
data-track-clicks | Fires Outbound Click for links to other domains and File Download for common file extensions (pdf, zip, dmg, docx, mp4, and similar). |
data-track-scroll | Fires Scroll Depth once per page at 25%, 50%, 75%, 90% and 100%. |
data-track-404 | Fires a 404 event when the page title or first heading looks like a not-found page. Powers the Pages → Not found report. |
<script defer src="https://t.thunderstats.com/ts.js"
data-site-id="YOUR_SITE_ID"
data-track-clicks data-track-scroll></script>
Content Security Policy
If your site sends a CSP header, allow the tracker host:
script-src https://t.thunderstats.com
connect-src https://t.thunderstats.com
The dashboard can generate an inline build of the tracker that needs only connect-src. Open Settings and switch the snippet to Inline (CSP-safe).
WordPress
Install the ThunderStats plugin, then connect it from Settings → ThunderStats. The plugin offers two modes:
- JavaScript — injects the script tag for you, with checkboxes for the auto-tracking options above.
- Server-side — sends pageviews from PHP with no JavaScript at all. Immune to ad blockers, and nothing is added to the page. Requires an API key.
Server-side mode uses the same endpoint documented in the HTTP API.
Verifying the install
Open your site in a normal browser tab, then check Realtime in the dashboard. Your visit should appear within a few seconds.
The most common causes are an ad blocker on your own machine (try a private window or your phone), a CSP that blocks the request, or a site ID that does not match the one in Settings. Server-side tracking avoids the first two entirely.