<head> tag and publish. The tag then loads on every page of the published site. Page changes without a full reload are tracked too, because the script listens to the History API.
Add the script
1
Copy the Framer snippet
In the CrispStats dashboard, open your site’s Settings, select Tracking code and choose the Framer tab. It has your public key filled in:
2
Paste it into End of head tag
In Framer, open Site settings, select General and scroll to Custom code. Paste the tag into the End of
<head> tag field and save.3
Publish the site
Publish your site, then open the published URL in a browser. The status row on the CrispStats Tracking code tab shows Receiving events. once the first event has been stored.
Add optional modules
The switches under Extra events on the Tracking code tab add attributes to the tag. Copy the updated tag from the Framer tab, replace the one in the custom code field and publish again. For example, with outbound links and web vitals on:data-domains with your own domain so only visits to that domain are counted. See script attributes.
Check that it works
- Open your published site with the browser’s developer tools on the Network tab. You should see
d.jsload fromin.crispstats.comand aPOSTtohttps://in.crispstats.com/ethat gets202. - Click to another page of the site. Another
POSTgoes out for the new URL, and both pages appear in CrispStats Realtime within seconds. - Open
https://in.crispstats.com/check?k=cs_pk_xxxxxxxxwith your key."site": "known"means the key is right.
data-domains names the domain visitors use.
How page changes are counted
The first load is one pageview. When a visitor moves to another page without a full reload, the URL changes through the History API, which the script watches, so each new page is one more pageview with the previous page as referrer. The same URL twice in a row is one pageview, and scrolling to a section with an#anchor link is not a new page. If Framer runs the code again on a later page, the second copy does nothing, so visits are not counted twice.
Send custom events
- Clicks to other sites and file downloads: turn on Outbound links and File downloads to add
data-outboundanddata-downloadsto the tag. No per-link setup is needed. - A form submission or a sign-up: send visitors to a thank-you page and add a goal with a Page visit rule for its path.
- Any other click: in an embed or code component where you control the HTML, add
data-cs-event="booking click"to the element, or callwindow.crispstats?.("booking click"). See declarative events.
FAQ
Why do I see no visits from the Framer preview?
Why do I see no visits from the Framer preview?
Custom code runs only on the published site. Publish, then open the live URL.
Does CrispStats count page changes on a Framer site?
Does CrispStats count page changes on a Framer site?
Yes, when the URL changes through the History API, which the script watches. Each new URL counts once. Clicking through pages in the check above confirms it on your site.
Framer details (custom code is not loaded in the canvas preview, site-wide custom code with head and body positions, and the newer Custom Code tab with placement, pages and run frequency) are from Framer’s lesson https://www.framer.com/academy/lessons/custom-code and help article https://www.framer.com/help/articles/how-to-add-custom-code/, read on 2026-11-23. Neither page stated a plan requirement.
Next steps
Single-page apps
How page changes without a reload are counted.
Track custom events
Send signups and other actions with
crispstats().Troubleshooting
What to check when no events arrive.