Single-page apps
Crustat counts a new page when the path or query changes through history.pushState or the back button. Clicking an anchor on the same page doesn't count twice.
Install
No developer needed. Sign up, copy your line, paste it into your website's settings. Done.
Create your account in a minute, no card needed. Your dashboard gives you your own Crustat line.
In your website's settings, look for a box called custom code, header code or head. Paste your line there and save.
Open your website once. About a minute later, your first visit shows up on your dashboard.
<script defer src="https://stats.crustat.com/script.js" data-site="YOUR-SITE-ID"></script> (an example: yours has your own site ID)
No cookies, no cookie banner needed. Why?
That's it. There's no step four.
Crustat counts a new page when the path or query changes through history.pushState or the back button. Clicking an anchor on the same page doesn't count twice.
If your site uses Cloudflare Rocket Loader or a plugin that combines or delays scripts, add data-cfasync="false" and leave the tag out of combining, so the script can find its own URL.
<script defer data-cfasync="false" src="https://stats.crustat.com/script.js" data-site="YOUR-SITE-ID"></script> Turn on Ignore my visits on this browser on your dashboard's Install page, or open your site once with this at the end of the address. That browser won't be counted again. The guide has the details.
https://your-site.com/#crustat-ignore The page address, the referrer on the first view and the window width; when a page is left, how long it was looked at; and the address of any link to another site that gets clicked. The server adds country, browser, device and an anonymous visitor ID that changes every day. Nothing is stored in your visitors' browsers, so no cookie banner is needed for Crustat. Visits from localhost are skipped.