StatelessID

Paste Snippet

Copy one script tag from your dashboard and paste it into every page you want to measure. That is all the install takes.

Get your snippet from the dashboard

After you choose a plan and log in with your access key, open the dashboard and look for the Install tab or the site settings panel. Every site you create gets its own snippet — a single HTML script tag with a data-k attribute that holds your site key.

The tag looks like this: <script src="https://statelessid.com/asset.js" data-k="YOUR_SITE_KEY"></script>. The only thing that changes between sites is the value of data-k. Keep that value private the same way you keep a password private — it identifies your account in the beacon.

If you have more than one site registered, each site has a different key. Do not reuse a key across domains unless you intentionally want their page views merged into one stream.

Where to paste it on a plain HTML site

Open the HTML file for each page you want to track. The script tag works anywhere in the document — inside <head> or just before the closing </body> tag. Paste it once per page. If your site uses a shared template or layout file that wraps every page, paste it there once and you are done.

Save the file and upload it to your server if it is not already live. Open the page in a browser, wait a few seconds, then reload your dashboard. If the count moves, the snippet is firing.

On a static site that builds from a template, find the layout or base template file. In Jekyll that is _layouts/default.html, in Hugo it is layouts/_default/baseof.html, in 11ty it is whatever template wraps your pages. Paste the tag once in the layout and every page the layout generates will send a beacon.

What the snippet does when a visitor loads a page

The script reads the data-k attribute to identify your site, measures the screen resolution class (small, medium, large, extra-large), checks the HTTP referrer to see where the visitor came from, then sends a single beacon to the StatelessID collector. The beacon carries no cookie, no persistent identifier, and no personal data. There is nothing to store on the visitor's device.

The beacon fires twice if the page takes an unusually long time to finish loading. That second fire is still one page view — it carries a load-time flag so the dashboard can show you slow pages without counting the visit twice.

If a JavaScript error is thrown before or during page load, a separate error beacon goes out. That is how the dashboard can surface scripting problems on your site without requiring any extra setup.

Confirming the install worked

Open your site in a normal browser tab (not incognito, not a bot). Wait for the page to fully load — the beacon fires on the load event. Then open your StatelessID dashboard and look at today's page view count. If the number went up by one, the snippet is working.

If the number did not change, open browser developer tools, go to the Network tab, and reload the page. Filter for "asset.js" in the request list. If you see the request, check its status code. A 200 means the script loaded. Then look for a request to "/t/c" — that is the beacon. If both show 200, data is flowing and your dashboard will catch up within a minute.

If you do not see the asset.js request at all, the script tag was not saved to the live page. Re-check that you saved and uploaded the right file, and that you are looking at the correct domain in the dashboard.

Troubleshooting

I pasted the tag but my dashboard shows zero page views. Check that the data-k value in your tag exactly matches the site key shown in your dashboard — a single wrong character breaks the beacon silently. Also confirm the page you loaded is the same domain you registered under that key.

The Network tab shows asset.js loaded but there is no beacon request. This usually means a Content Security Policy on your server is blocking outbound requests to statelessid.com. Add connect-src https://statelessid.com to your CSP header to allow the beacon.

My page view count went up by more than one when I tested. If you tested in multiple tabs or refreshed the page several times, each full page load fires one beacon. That is correct behavior. Check the Pages column in your dashboard to see which URL those views came from.

Similar pages