<script> tag you add to your site’s HTML <head>. Once it’s live, tinyanalytics collects pageviews and common interactions automatically — you don’t have to write any code to get started. The script is under 6.5 KB gzipped, loads with defer, and never blocks your page.
Prerequisites
- A tinyanalytics account and a site added in the dashboard. If you haven’t done this yet, follow the Quickstart.
Install the script
1
Copy the script from your dashboard
Open your site in tinyanalytics. On a new site, the tracking script is on the setup panel; on an existing site, it’s in Settings → Tracking. Copy the tag exactly as shown — it already includes your numeric
data-site-id:2
Paste it into your HTML head
Add the tracking script before the closing
</head> tag, on every page you want to measure. Placing it in the <head> means visits are recorded as soon as the page loads.3
Deploy and check
Publish your site, visit a page, and open your dashboard.
The install is working when your own visit appears in the dashboard within a few seconds. If it doesn’t, see verify your setup.
What the script tracks out of the box
With the default tracking script, tinyanalytics captures the following automatically — no extra code:- Pageviews, including client-side route changes in single-page apps.
- Outbound link clicks and file downloads.
- Button clicks, text copies, and form submissions (form shape only — field values are never captured).
- Engagement — scroll depth and engaged time per page visit.
data-* attributes.
Where do I get my tracking script?
Always copy the tracking script from your dashboard. It fills in the correctdata-site-id and uses the exact script URL for your account. Find it on a new site’s setup panel, or under Settings → Tracking for any existing site. Copy it rather than typing it by hand.
Framework and CMS installs
The install is the same everywhere — the tracking script goes in the HTML<head> — but where you paste it differs by platform:
- HTML sites — paste directly into your
<head>. - Frameworks (Next.js, React, Vue, Svelte, and others) — add the tag to your root layout or document head component so it loads on every route. Single-page route changes are tracked automatically (SPA routing is on by default).
- Site builders and CMSs (WordPress, Webflow, Framer, Ghost, and others) — use the platform’s “custom code” or “head” setting to add the tracking script site-wide.
<head> on every page.
Bypass ad blockers
Some ad blockers block third-party analytics requests, which can undercount visits. tinyanalytics supports serving the script and receiving events through a first-party proxy on your own domain, so tracking looks like part of your site. You point the tracking script’ssrc at your own domain, and requests are forwarded to tinyanalytics behind the scenes.
A dedicated proxy and custom-domain guide is being added. If you need it now, contact support from your dashboard.
Frequently asked questions
Does the tinyanalytics tracking script slow down my site?
Does the tinyanalytics tracking script slow down my site?
No. The tinyanalytics tracking script is under 6.5 KB gzipped and loads with
defer, so the browser runs it after the HTML has parsed. It never blocks your page from loading.Do I have to add the tracking script to every page?
Do I have to add the tracking script to every page?
Yes — add it to every page you want to measure. On a framework or CMS, add it once in a shared root layout, template, or “custom code” head setting so it loads site-wide instead of pasting it per page.
Why is tinyanalytics undercounting my visits?
Why is tinyanalytics undercounting my visits?
Ad blockers are the usual cause: some block third-party analytics requests before they’re sent. Serve the tinyanalytics tracking script through a first-party proxy on your own domain so requests look like part of your site and aren’t blocked.
Where do I find my site ID?
Where do I find my site ID?
Your numeric
data-site-id is already filled in on the tracking script shown in your dashboard — on a new site’s setup panel, or under Settings → Tracking for an existing site. Copy the tag from there rather than typing the ID by hand.Related
Configure the script
Every
data-* attribute and what it controls.Verify your setup
Confirm the install and fix common problems.
Track custom events
Send your own named events.
How tinyanalytics works
What the script sends and how it’s counted.