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

# Get started with CrispStats in five minutes

> Learn how to add a site to CrispStats, install the tracking script, confirm the first visit and send your first custom event in about five minutes.

To start using CrispStats, add your site in the dashboard, paste one script tag into your pages, and wait for the first pageview to arrive. This guide then sends a custom event, so you leave with pageviews and events both flowing.

You need a CrispStats account and the ability to edit your site's HTML or layout. Every account starts with a 14-day free trial, no card required, with every feature.

**1. Create an account**

Sign up at [crispstats.com/signup](https://crispstats.com/signup). When your account has no sites yet, signing in takes you straight to the **Add your site** step.

**2. Add your site**

Fill in the form and select **Add site**:

* **Domain**: the domain of your site, like `example.com`. Subdomains are counted too. If you paste a full URL, only the domain is kept.
* **Site name**: how the site shows in your list of sites.
* **Timezone**: days in your reports start and end in this timezone. It defaults to your browser's timezone.
* **Workspace**: shown only when you can add sites to more than one workspace. Everyone in the workspace you pick can open the site.

You can change all of these later in the site's settings. CrispStats creates the site and gives it a public key that starts with `cs_pk_`. The key tells the collector which site an event belongs to, and it is safe to publish.

**3. Paste the script**

The **Install the script** step shows the tag with your key filled in, plus tabs with the exact code for each framework. For a plain HTML site, add this inside `<head>` on every page:

```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 `cs_pk_xxxxxxxx` with your key and `example.com` with your domain: `data-domains` keeps preview deployments and copies of your site from being counted. Use a classic script tag with `defer` or `async`: `type="module"` does not work, because the script reads its options from its own tag.

For Next.js, React, Vue, Astro, SvelteKit, WordPress, Shopify and other platforms, follow the matching [install guide](https://docs.crispstats.com/install/overview.md). Deploy the change, then select **I have added it**.

**4. Confirm the first visit**

The **First visitor** step listens for events from your domain and checks every 3 seconds. Open your live site in a browser where the script is in place. The first pageview shows up within a few seconds, the step confirms the install, and **Open dashboard** takes you to the site's overview.

> [!WARNING]
>
> The script ignores pages on `localhost`, `127.0.0.1` and `file://`, and automated browsers such as Playwright, so development visits and test runs do not count. Open your deployed site in a normal browser window. To see events on `localhost`, add `data-debug` to the tag: it logs every event in the console and sends nothing. See [localhost and testing](https://docs.crispstats.com/tracking/localhost-and-testing.md).

If nothing arrives after a minute, check for an ad blocker, a Content Security Policy that blocks `in.crispstats.com`, or a cached version of the page without the tag. [Troubleshooting](https://docs.crispstats.com/help/troubleshooting.md) walks through each cause.

**5. Send a custom event**

Call the `crispstats` global wherever the action happens, with an event name and optional flat properties:

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
crispstats("signup", { plan: "pro" });
```

Or track a click without writing JavaScript, using HTML attributes:

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<button data-cs-event="add to cart" data-cs-prop-sku="tee-01">Add to cart</button>
```

Trigger the action on your site, then open **Events** in the dashboard sidebar. The event appears with its properties. To call `crispstats()` from inline code that may run before the script loads, add the queue stub described in [custom events](https://docs.crispstats.com/track/custom-events.md).

> [!TIP]
>
> Your site now reports pageviews, sources, engagement and custom events. With the default setup the script sets no cookie and stores nothing on your visitors' devices. See [cookieless tracking](https://docs.crispstats.com/privacy/cookieless-tracking.md) for how visitors are counted.

## Next steps

> [card] [Turn on optional modules](https://docs.crispstats.com/tracking/script-attributes.md)
>
> Add outbound links, file downloads, web vitals, JavaScript errors and 404 tracking with one attribute each.

> [card] [Set up goals](https://docs.crispstats.com/dashboard/goals.md)
>
> Mark the events and pages that count as conversions.

> [card] [Connect revenue](https://docs.crispstats.com/revenue/overview.md)
>
> Attribute payments from Stripe and other providers to the visit that led to them.

> [card] [Count ad-blocked visitors](https://docs.crispstats.com/tracking/proxy.md)
>
> Serve the script and collector from your own domain.


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