Skip to main content

Plain HTML

Static websites only need the standard script tag.

Add the script

Place the snippet before the closing </head> tag:

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example</title>
<script defer src="https://purestats.io/pf.js" data-domain="example.com"></script>
</head>
<body>
...
</body>
</html>

Deploy the change and open the page in a browser. PureStats should receive a pageview after the script loads.

Multiple pages

Add the script to your shared layout, include, partial or template so it appears on every public page. Avoid manually adding it page by page unless the site is very small.

Excluded pages

If the script is part of a shared layout but some paths should not be tracked, use Path exclusions. Typical exclusions are:

  • /admin
  • /admin/*
  • /preview/*
  • /account/billing

Content Security Policy

If your site uses CSP, allow the tracker source and event endpoint:

script-src 'self' https://purestats.io;
connect-src 'self' https://purestats.io;

Keep the policy as strict as possible while allowing pf.js and its network request.