Skip to main content
To install CrispStats on a plain HTML site, paste one <script> tag inside <head> on every page and deploy. The script then tracks pageviews, single-page navigation and time on page. By default it sets no cookie and stores nothing on the visitor’s device. This guide also covers the optional modules and how to confirm that events arrive.

Add the script

1

Copy the snippet

In the dashboard, open your site’s Settings and select Tracking code. The HTML tab shows the tag with your public key filled in. You can also copy it from the command menu with Copy tracking snippet.
2

Paste it inside head on every page

Put the tag inside <head>. If your pages share a header include or template, add it there once.
index.html
Keep defer (or use async) and do not add type="module": the script reads its options from its own tag, which a module script cannot do.
3

Deploy and open your site

Publish the change, then open your live site in a normal browser window. Pages on localhost, *.localhost, 127.x.x.x, [::1] and file:// are ignored, so a local preview does not count, and neither do automated browsers. See localhost and testing to test before you ship.

Turn on optional modules

The base script tracks pageviews and engagement. Each optional module starts working when its attribute is on the tag. On the Tracking code tab, the switches under Extra events and How pages are counted add these attributes to the snippet for you. Two more switches change how pages are counted: Hash routing (data-hash, only for sites whose URLs look like /#/pricing) and Manual pageviews (data-manual). See single-page apps. With every module on, the tag looks like this:
The switches only change the snippet shown in the dashboard. A module starts working once the updated tag is on your site. Other attributes, such as data-exclude, data-keep-params and data-debug, are described in script attributes.

Confirm the install

The status row at the top of the Tracking code tab checks the install every five seconds while the tab is open, and you can select Check again to ask at once. It shows one of these states: Once the status reads Receiving events., open Realtime or the overview to see the visit. If the status stays on Waiting for the first event… after you have opened your live site, check for:
  • An ad blocker or privacy extension in your browser that blocks in.crispstats.com. See ad blockers.
  • A Content Security Policy that does not allow in.crispstats.com for scripts and connections. See Content Security Policy.
  • A cached copy of the page without the tag.
  • localStorage.crispstats_ignore set to "1" in your browser, which turns tracking off for that browser. See exclude traffic.
Troubleshooting walks through each cause.

Next steps

Track custom events

Send signups, purchases and other actions with crispstats().

Exclude your own visits

Keep your browser and private paths out of the numbers.

Script attributes

Every option the script tag accepts.
Last modified on November 18, 2026