Getting started
Install
Add the tracker to plain HTML, single-page apps and Next.js, and what to allow in a Content Security Policy.
Plain HTML or a template
Put the snippet in the <head> of your layout so it is on every page. Keep the defer attribute.
Single-page apps (React, Vue, Svelte and similar)
Add the same snippet to your root HTML file, for example index.html. Route changes made with the History API are counted as pageviews automatically, so you do not need any router integration.
Next.js
import Script from 'next/script' // in your root layout <Script src="https://quietlytics.app/tracker.js" strategy="afterInteractive" />
Client-side navigations are counted as pageviews. The tracker works out where to send events from the address it was loaded from, so there is nothing else to configure.
Content Security Policy
If your site sends a Content-Security-Policy header, add https://quietlytics.app to script-src (to load the tracker) and to connect-src (to send events). Nothing else is needed: the tracker adds no styles, images, frames or inline code.
Local development and staging
The tracker ignores localhost, 127.x and [::1], and localhost cannot be verified, so your own local testing never reaches your numbers. To test the install end to end, use a staging domain such as staging.example.com. Add and verify it like any other website, then remove it when you are done.