> ## 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 Wix

> Add the CrispStats script to a Wix site with Settings, Custom Code: paste the tag, load it on all pages in the head. Needs a published site with a connected domain.

To install CrispStats on Wix, add the script tag as custom code in your site's dashboard, set to load on all pages and placed in the head. Wix only lets you add custom code to a site that is published and has a connected domain.

You need your site's public key, which starts with `cs_pk_`. Find it in CrispStats under **Settings**, **Tracking code**, on the **HTML** tab. The key is safe to publish.

## Add the script

**1. Copy the tag**

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

Replace the key with yours and `example.com` with your connected domain.

**2. Open Custom Code**

In your Wix site's dashboard, open **Settings** and select **Custom Code**, under **Development & integrations**. Select **+ Add Custom Code**.

**3. Paste and place it**

Paste the tag and give it a name you will recognise, such as `CrispStats`. Under **Add Code to Pages**, choose **All pages** and load it once per visit. Under **Place Code in**, choose **Head**. Save.

**4. Open your live site**

Open your site on its connected domain in a normal browser window, not in the editor. The status row on the CrispStats **Tracking code** tab shows **Receiving events.** once the first event has been stored.

> [!NOTE]
>
> Wix's own help page says custom code needs a published site with a connected domain. The page did not name a specific plan when we read it. Google Tag Manager does not work through Wix custom code, according to the same page, so use the script tag above rather than the [Google Tag Manager](https://docs.crispstats.com/install/google-tag-manager.md) method.

## Check that it works

* Open your live 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 through to a few other pages. Each page change sends another `POST`, and the 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.

If nothing arrives, check `data-domains`: it must name the domain visitors use. A visit on a hostname outside the list is not counted. See [troubleshooting](https://docs.crispstats.com/help/troubleshooting.md).

## How page changes are counted

A full page load counts once. If a page change happens without a reload and the URL changes through the History API, the script counts the new URL as a pageview too, so clicking through the site in the check above shows whether each page arrives. If the code also runs again on each page, the second copy does nothing, so visits are never counted twice. The same URL twice in a row is one pageview.

## Add optional modules

Add attributes to the tag in your custom code and save. In HTML, a flag attribute is bare:

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

`data-outbound` counts clicks to other sites and `data-downloads` counts file downloads. See [script attributes](https://docs.crispstats.com/tracking/script-attributes.md) for the rest.

## Send custom events

If you can add HTML elements (for example with an embed), put `data-cs-event` on a link or button to count clicks:

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<a href="https://example.com/book" data-cs-event="booking click">Book a call</a>
```

See [declarative events](https://docs.crispstats.com/track/declarative-events.md). To count a form submission without code, make the form's thank-you page a goal with a **Page visit** rule. See [goals](https://docs.crispstats.com/dashboard/goals.md).

## FAQ

> [accordion] Why can't I find Custom Code?
>
> Wix's help page says custom code needs a published site with a connected domain. Publish the site and connect your domain, then look again under **Settings**.

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

> [accordion] Can I serve the script from my own domain on Wix?
>
> A [forwarding proxy](https://docs.crispstats.com/tracking/proxy.md) needs a server rule on your domain that sends one path to the collector. Without a way to add one, load the script from `in.crispstats.com` as shown here. See [ad blockers](https://docs.crispstats.com/help/ad-blockers.md) for what that means for your counts.

## Next steps

> [card] [Goals](https://docs.crispstats.com/dashboard/goals.md)
>
> Count thank-you pages and clicks as conversions.

> [card] [Exclude your own visits](https://docs.crispstats.com/tracking/exclude-traffic.md)
>
> Keep your own browser out of the numbers.

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

> [!NOTE]
>
> Wix details (the **Custom Code** path, **Head** placement, **All pages** scope, the published site and connected domain requirement and the note that Google Tag Manager does not work through custom code) are from Wix's help page "Wix Editor: Embedding Custom Code on Your Site", [https://support.wix.com/en/article/embedding-custom-code-on-your-site](https://support.wix.com/en/article/embedding-custom-code-on-your-site), read on 2026-11-23.


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