PureStats documentation
Tracking script reference
Explore the PureStats tracking script reference, including installation, data attributes, event endpoints, browser support and first-party proxy configuration.
The canonical PureStats tracker is pf.min.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.min.js" data-domain="example.com"></script>
Attributes
| Attribute | Required | Description |
|---|---|---|
data-domain |
Yes | Canonical PureStats site domain. |
data-api |
No | Custom event endpoint. Defaults to PureStats. |
data-config-api |
No | Custom tracker configuration endpoint. Derived from data-api by default. |
data-consent-mode |
No | Explicit client-side consent mode override. Prefer Site Settings. |
data-respect-dnt |
No | Explicit Do Not Track override. Prefer Site Settings. |
data-exclude-paths |
No | Client-side path exclusions for advanced deployments. Prefer Site Settings. |
data-cross-domain |
No | Explicit cross-domain stitching override. Prefer Site Settings. |
data-allowed-domains |
No | Explicit comma-separated alias list for cross-domain stitching. Prefer Site Settings. |
data-linker |
No | Enables or disables the optional cross-domain linker parameter. |
First-party proxy
For first-party proxy setups, load pf.min.js from your own domain and set data-api to your proxied event endpoint:
<script
defer
src="https://example.com/pf.min.js"
data-domain="example.com"
data-api="https://example.com/api/event"
></script>
The tracker derives https://example.com/api/tracker-config from data-api unless data-config-api is set explicitly. See First-party proxy for server configuration examples.
When Core Web Vitals, active experiments, no-code events, site search or session replay require optional functionality, the core tracker loads /pf-vitals.min.js, /pf-experiments.min.js, /pf-events.min.js, /pf-search.min.js or /pf-replay.min.js. First-party proxies must forward and may cache these files in the same way as /pf.min.js.
Event endpoint
The tracker sends events to:
https://purestats.io/api/event
The API validates the domain or alias, path exclusions, consent 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.min.js as the public integration file.