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

# Set up goals and conversions in CrispStats

> Create CrispStats goals from a custom event or a page path with wildcards, give them a value, and see completions and conversion rate on the dashboard.

A goal in CrispStats is a custom event or a page visit that counts as a conversion. Once you add one, CrispStats counts its completions, the visitors who completed it and the conversion rate (those visitors as a share of all visitors), for any date range and filter. Goals count from your existing data, so a new goal immediately shows figures for past events and pageviews that match it.

You create and edit goals on the [Events](https://docs.crispstats.com/dashboard/events.md) screen. Owners, admins and members can change goals; viewers can only see them.

## Add a goal

**1. Open Events**

Select **Events** in the sidebar, or press `g` then `e`. The **Goals** section is at the top.

**2. Select Add goal**

The **Add goal** dialog opens.

**3. Name it**

Enter a **Name** of up to 80 characters, like `Sign up`.

**4. Choose what completes it**

Under **Completed by**, choose **Custom event** or **Page visit**:

* **Custom event**: pick an event the site already sends (they are listed busiest first with their counts), or type the name of one you are about to add. Type it exactly as your code sends it.
* **Page visit**: enter a path that starts with `/`, like `/pricing`. You can use wildcards, described below.

**5. Optionally give it a value**

Enter a **Value per completion** in the site's currency, like `5` or `4.50`, to count that much revenue each time the goal is completed. Leave it empty for goals that are not worth a fixed amount.

**6. Save**

Select **Add goal**. The goal appears as a card, and every report counts it, including the events and pageviews already stored.

To change or remove a goal, open the menu on its card and select **Edit goal** or **Delete goal**. Deleting a goal removes it from every report, but keeps the events and pageviews behind it.

## How goals match

### Event goals

An event goal matches every custom event whose name is exactly the goal's event name. Names are case sensitive: `Signup` and `signup` are different events.

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
// Completes an event goal set to "signup".
crispstats("signup", { plan: "pro" });
```

### Page goals and wildcards

A page goal matches pageviews whose path matches the pattern from start to end. Without wildcards, the path must be exactly the pattern.

| Pattern | Matches | Does not match |
| - | - | - |
| `/pricing` | `/pricing` | `/pricing/team`, `/de/pricing` |
| `/blog/*` | `/blog/launch`, `/blog/pricing-update` | `/blog`, `/blog/2026/launch` |
| `/blog/**` | `/blog/launch`, `/blog/2026/launch` | `/blog` |
| `/docs/*/install` | `/docs/react/install` | `/docs/react/v2/install` |

* `*` matches any characters within one path segment, so it never crosses a `/`. `/docs*` matches `/docs` and `/docs-v2`, but not `/docs/install`.
* `**` matches any characters, including `/`, so it covers a whole section at any depth.
* Every other character matches itself. Paths are compared case sensitively, after the collector has removed query strings and normalised slashes.

> [!TIP]
>
> `/docs/**` does not match `/docs` itself. To count the section page as well, add a second goal for `/docs`.

## Where conversions appear

| Place | What it shows |
| - | - |
| **Events**, **Goals** cards | One card per goal: the conversion rate (with change when comparison is on), a sparkline of completions, **Completions** (with change), **Visitors** and **Revenue**. |
| Overview, **Events and goals** card | Goals by completions, with their conversion rate. Selecting a goal on an event or an exact page filters the dashboard by it. See [the overview](https://docs.crispstats.com/dashboard/overview.md#events-and-goals-card). |
| REST API and MCP | Goal stats through `GET /api/v1/sites/{siteId}/goals` and the `list_goals` MCP tool. See the [API reference](https://docs.crispstats.com/api-reference/introduction.md). |

How the figures are counted:

* **Completions**: every matching event or pageview in the range. A visitor who views `/pricing` three times completes a `/pricing` goal three times.
* **Visitors**: the unique visitors with at least one completion.
* **Conversion rate**: those visitors divided by all visitors in the range, up to 100%.
* **Revenue**: the goal's value times its completions. Goals without a value show no revenue.

Goal figures follow the date range and filters, like every other report. If nothing matched a goal in the range, its card says that it counts from the first matching event or visit.

> [!NOTE]
>
> The **Conversion rate** KPI on the overview is a different number: it counts visitors who became paying customers. Goal conversion rates are shown on each goal.

## Next steps

> [card] [Explore events](https://docs.crispstats.com/dashboard/events.md)
>
> See every custom event and its properties.

> [card] [Build a funnel](https://docs.crispstats.com/dashboard/funnels.md)
>
> Chain goals and pages into ordered steps.

> [card] [Send custom events](https://docs.crispstats.com/track/custom-events.md)
>
> Track signups, checkouts and clicks from your code.


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