Skip to main content
To install CrispStats on Framer, paste the script tag into the site-wide custom code field for the end of the <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:
If your site is also reachable on a Framer preview or staging domain, add 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.js load from in.crispstats.com and a POST to https://in.crispstats.com/e that gets 202.
  • Click to another page of the site. Another POST goes out for the new URL, and both pages appear in CrispStats Realtime within seconds.
  • Open https://in.crispstats.com/check?k=cs_pk_xxxxxxxx with your key. "site": "known" means the key is right.
Framer does not load custom code in the canvas preview, so test on the published URL. Framer’s newer interface may label the setting Custom Code in the project or site settings, with a choice of position and pages: choose a position in the head and do not limit it to specific pages. If nothing arrives, check that the tag went into the head field and not the body field, that you published after saving, and that 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-outbound and data-downloads to 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 call window.crispstats?.("booking click"). See declarative events.

FAQ

Custom code runs only on the published site. Publish, then open the live URL.
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.
Last modified on November 23, 2026