> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crispstats.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> CrispStats is a hosted, privacy-first web analytics product. It has no self-hosted edition, no session replay, no heatmaps, no A/B testing, no mobile SDKs and no data import except a site's history from a Plausible export (Settings, Import and export).
> The script global is crispstats(...), site keys start with cs_pk_ and secret API keys start with cs_sk_. The script is served from https://in.crispstats.com/d.js and the REST API lives at https://crispstats.com/api/v1.
> There is no npm package to install. Integrations copy the script tag, the queue stub, crispstats.d.ts and proxy code from these docs or from Settings, Tracking code in the dashboard. A first-party proxy forwards one path of the site to https://in.crispstats.com/p/ and forwards only content-type, user-agent, accept-language, referer, origin, if-none-match and x-forwarded-for, never cookies.

# Install CrispStats on Framer

> Add the CrispStats script to a Framer site by pasting the tag into Site settings, General, Custom code, End of head tag, then publishing your site.

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:

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<!-- Site settings, General, Custom code, End of <head> tag. -->
<script
  defer
  data-site="cs_pk_xxxxxxxx"
  data-domains="example.com"
  src="https://in.crispstats.com/d.js"
></script>
```

**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:

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<script
  defer
  data-site="cs_pk_xxxxxxxx"
  data-domains="example.com"
  data-outbound
  data-vitals
  src="https://in.crispstats.com/d.js"
></script>
```

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](https://docs.crispstats.com/tracking/script-attributes.md).

## 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](https://docs.crispstats.com/dashboard/goals.md) 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](https://docs.crispstats.com/track/declarative-events.md).

## FAQ

> [accordion] Why do I see no visits from the Framer preview?
>
> Custom code runs only on the published site. Publish, then open the live URL.

> [accordion] 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.

> [accordion] Do I need a cookie banner for CrispStats?
>
> By default the script sets no cookie and stores nothing on the visitor's device. See [compliance](https://docs.crispstats.com/privacy/compliance.md). This is not legal advice.

> [!NOTE]
>
> 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](https://www.framer.com/academy/lessons/custom-code) and help article [https://www.framer.com/help/articles/how-to-add-custom-code/](https://www.framer.com/help/articles/how-to-add-custom-code/), read on 2026-11-23. Neither page stated a plan requirement.

## Next steps

> [card] [Single-page apps](https://docs.crispstats.com/tracking/single-page-apps.md)
>
> How page changes without a reload are counted.

> [card] [Track custom events](https://docs.crispstats.com/track/custom-events.md)
>
> Send signups and other actions with `crispstats()`.

> [card] [Troubleshooting](https://docs.crispstats.com/help/troubleshooting.md)
>
> What to check when no events arrive.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.