Skip to main content

Tracking script reference

The canonical PureStats tracker is pf.js. The default installation only needs data-domain; site-level behavior is loaded from PureStats automatically.

Basic snippet

<script defer src="https://purestats.io/pf.js" data-domain="example.com"></script>

Attributes

AttributeRequiredDescription
data-domainYesCanonical PureStats site domain.
data-apiNoCustom event endpoint. Defaults to PureStats.
data-config-apiNoCustom tracker configuration endpoint. Derived from data-api by default.
data-consent-modeNoExplicit client-side consent mode override. Prefer Site Settings.
data-respect-dntNoExplicit Do Not Track override. Prefer Site Settings.
data-exclude-pathsNoClient-side path exclusions for advanced deployments. Prefer Site Settings.
data-cross-domainNoExplicit cross-domain stitching override. Prefer Site Settings.
data-allowed-domainsNoExplicit comma-separated alias list for cross-domain stitching. Prefer Site Settings.
data-linkerNoEnables or disables the optional cross-domain linker parameter.

Event endpoint

The tracker sends events to:

https://purestats.io/api/event

The API validates the domain or alias, path exclusions, consent state, quota state and bot/spam scoring before storing the event.

Before the first event, the tracker also reads:

https://purestats.io/api/tracker-config

That response applies the current Site Settings without requiring extra attributes in the script tag.

Browser support

The tracker is designed for modern browsers. If a browser blocks JavaScript, analytics events cannot be collected.

Versioning

PureStats builds the minified tracker from source and exposes version/checksum metadata for release checks. Use pf.js as the public integration file.