# Framer analytics with CrispStats

Updated 2026-11-23

To add CrispStats to a Framer site, paste the script tag into the site-wide custom code, placed at the end of the head, and publish. Framer changes pages without a full reload, and the script counts each new page because it watches the History API.

## Steps

### 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 (it starts with `cs_pk_`) and your domain filled in. The key is safe to publish.

```html
<script
  defer
  data-site="cs_pk_your_site_key"
  data-domains="example.com"
  src="https://in.crispstats.com/d.js"
></script>
```

### 2. Open the site-wide custom code

Framer's [help article](https://www.framer.com/help/articles/how-to-add-custom-code/) puts it under **Project Settings**, on the **Custom Code** tab: select **Add Script**, or the **+** icon if the project already has code. Older projects show the same setting under **Site settings**, **General**, **Custom code**, with an **End of `<head>` tag** field.

### 3. Place it in the head, on every page

Name the script so you can find it later, such as CrispStats. Choose a placement in the head (Framer's [custom code lesson](https://www.framer.com/academy/lessons/custom-code) lists the start or end of the head and body), do not limit it to specific pages, and save.

### 4. Publish and open the live site

Framer does not load custom code in the canvas preview, so publish, then open the published URL in a normal browser window.

### 5. Turn on extra events (optional)

The switches under **Extra events** on the **Tracking code** tab add attributes to the tag. Copy the updated tag, replace the one in Framer and publish again. With outbound links and web vitals on:

```html
<script
  defer
  data-site="cs_pk_your_site_key"
  data-domains="example.com"
  data-outbound
  data-vitals
  src="https://in.crispstats.com/d.js"
></script>
```

### 6. Count a click in an embed (optional)

In an embed or code component where you control the HTML, add `data-cs-event` to a link or button. No JavaScript is needed; in your own code, call `window.crispstats?.("booking click")` instead.

```html
<a href="https://example.com/book" data-cs-event="booking click">Book a call</a>
```

## Check that it works

Open your published site with the developer tools on the **Network** tab: `d.js` loads from `in.crispstats.com` and a `POST` to `/e` gets `202`. Click to another page: a second `POST` goes out for the new URL, and both pages appear on the **Realtime** screen within seconds. The status row on the **Tracking code** tab shows **Receiving events.** If nothing arrives, check that the tag went into a head position and not the body, that you published after saving, and that `data-domains` names the domain visitors use.

## What you get

- One pageview for the first load and one more for each page a visitor moves to, with the previous page as referrer. The same URL twice in a row is one pageview.
- Which channel brings visitors to each Framer page: search, social, a launch post tagged with UTM parameters, or an AI assistant such as ChatGPT.
- A core script of about 2.2 KB gzipped that loads with `defer`, so it does not hold up the first paint of your Framer page.
- Optional [web vitals](/features/web-vitals) from real visits (LCP, INP and CLS at p75), outbound link clicks and file downloads, each switched on with one attribute.
- Sign-ups and form submissions as [goals](/glossary/goal): send visitors to a thank-you page and add a goal with a **Page visit** rule for its path.

## Notes for Framer

- Framer's help article and lesson, read on 2026-11-23, did not state a plan requirement for custom code, and the pricing page did not mention it. If you do not see the setting, check your plan with Framer.
- Framer's [pricing page](https://www.framer.com/pricing) says a custom domain needs a paid plan. On the Free plan the site lives on Framer's free domain, so put that hostname in `data-domains`, or visits are not counted.
- If Framer runs the code again on a later page, the second copy of the script does nothing, so visits are never counted twice.
- Scrolling to a section with an `#anchor` link is not a new page. Framer routes with real paths, so leave out `data-hash`.
- Framer cannot run the forwarding rule that serves the script from your own domain, so the script loads from `in.crispstats.com` and visitors whose ad blocker stops that host are not counted. If your domain already runs through Cloudflare, a Worker route on it can do the forwarding: see [the proxy guide](/docs/tracking/proxy).
- Preview and staging hostnames are left out when `data-domains` lists only your own domain. Add a hostname to count it too.

Full reference: [Framer in the docs](https://docs.crispstats.com/install/framer)

## Frequently asked questions

### Does it count page changes on a Framer site without a reload?

Yes. Framer changes the URL through the History API when a visitor moves between pages, and the script counts each new URL as one pageview.

### Why do I see no visits from the Framer preview?

Framer does not load custom code in the canvas preview. Publish the site, then open the live URL on the domain listed in the tag.

### Which Framer plan do I need for custom code?

Framer's help article and custom code lesson did not name a plan when we read them on 2026-11-23. If the Custom Code setting is missing in your project, ask Framer what your plan includes.

### Are Framer CMS pages counted?

Yes. Site-wide custom code is on every page Framer publishes, CMS item pages included, and each one is reported under its own path.

### What does it cost for a Framer site?

A Framer site sends pageviews only, unless you tag buttons with data-cs-event. Every account starts with a 14-day free trial with every feature and no card; then Starter is $5 a month for 250,000 events. Paid plans never pause: if a launch pushes you past your plan, extra events are billed and nothing is dropped.

## Related

- [Web analytics for startups](/for/startups)
- [Funnels and goals](/features/funnels)
- [Core Web Vitals in plain English](/blog/core-web-vitals-plain-english)
- [Cookieless analytics explained](/blog/cookieless-analytics-explained)
- [Webflow analytics](/integrations/webflow)
