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

# Manage sites and site settings

> Add a site, change its name, domain, extra hostnames, timezone and currency, rotate its public key, or transfer, reset or delete it from the danger zone in CrispStats.

A site in CrispStats is one tracked domain with its own public key, settings and reports. You add sites from the dashboard, edit their details under **Settings**, and transfer, reset or delete them from the **Danger zone** tab. Owners and admins of the workspace that owns a site can change its settings; members and viewers see the same screens read-only. Team and API keys belong to the whole workspace, so they live on the [workspace page](#workspaces), not in a site's settings.

## Add a site

You need to be an owner or admin of at least one workspace. Your plan's site limit applies: the trial includes 2 sites, Starter 10, and Growth and Scale have no limit (see [plans and limits](https://docs.crispstats.com/account/plans-and-limits.md)).

**1. Open the add site form**

Select **Add site** on your list of sites, in the site switcher, or in the command palette. The form opens at [crispstats.com/app/new](https://crispstats.com/app/new).

**2. Fill in the site**

* **Domain**: the domain of your site, like `example.com`. A pasted URL is reduced to its domain, and a leading `www.` is dropped. Subdomains are counted too.
* **Site name**: how the site appears in your list. It is filled in from the domain, for example `Acme` for `acme.com`, until you type your own. Clear it to use the domain itself. At most 80 characters.
* **Timezone**: days in your reports start and end in this timezone.
* **Workspace**: shown only when you are an owner or admin of more than one workspace. Everyone in it can open the site.

Each domain can be added once per workspace. New sites report revenue in US dollars until you change the currency in settings.

**3. Install the script**

Select **Add site**. CrispStats creates the site with a public key that starts with `cs_pk_` and shows the script tag for it. The [quickstart](https://docs.crispstats.com/quickstart.md) covers the install and the first-visit check.

If the workspace is at its site limit, the form says `Your plan's site limit is reached. Upgrade to add another site.` and offers **Open billing**. If you are not an owner or admin of any workspace, the form explains that only owners and admins can add sites.

## Where site settings live

Open a site, then **Settings** in the sidebar. Each tab has its own address, so you can link straight to one.

| Tab | Path | What it holds |
| - | - | - |
| General | `/app/<siteId>/settings` | Site details, bot filtering, excluded paths and IP addresses, persistent visitors |
| Tracking code | `/app/<siteId>/settings/tracking` | The script snippet, the proxy setup, the public key and [Connect an AI assistant](https://docs.crispstats.com/ai/connect-ai-assistants.md) |
| Revenue | `/app/<siteId>/settings/integrations` | [Payment providers](https://docs.crispstats.com/revenue/overview.md), connected with a key, and the payment API |
| Sharing and widgets | `/app/<siteId>/settings/sharing` | The [public dashboard](https://docs.crispstats.com/share/public-dashboard.md) and [widgets](https://docs.crispstats.com/share/widgets.md) |
| Import and export | `/app/<siteId>/settings/data` | [Import from Plausible](https://docs.crispstats.com/switch/import-from-plausible.md), [CSV export](https://docs.crispstats.com/share/csv-export.md) and [raw events](https://docs.crispstats.com/share/raw-events.md) |
| Danger zone | `/app/<siteId>/settings/danger` | [Transfer the site](https://docs.crispstats.com/account/transfer-a-site.md), [reset its stats](https://docs.crispstats.com/account/reset-stats.md) or delete it |

Below the tabs, **Team and API keys** opens the [workspace page](#workspaces) of the workspace that owns the site. Goals are created and edited on the site's **Events** page. Addresses of tabs that moved keep working: `settings/goals` opens the Events page, `settings/widgets` the widgets on **Sharing and widgets**, and `settings/team` and `settings/api-keys` the workspace page.

Bot filtering, excluded paths and IP addresses have their own guides: [bot filtering](https://docs.crispstats.com/privacy/bot-filtering.md) and [exclude traffic](https://docs.crispstats.com/tracking/exclude-traffic.md). Persistent visitors is covered in [persistent visitors](https://docs.crispstats.com/privacy/persistent-visitors.md).

## Change site details

The **Site details** group on the **General** tab holds five fields. Change any of them, then select **Save changes**. **Discard** puts back the saved values.

| Field | Rules | What it changes |
| - | - | - |
| Site name | Required, at most 80 characters | How the site is labelled in the dashboard |
| Domain | A domain like `example.com`, without a path | Which hostname the collector accepts events from |
| Additional hostnames | Optional, up to 50, each a hostname like `app.example.com` | Other addresses that serve this site |
| Timezone | One of the listed timezones | Where days in your reports start and end |
| Currency | A three-letter code, such as `USD` or `EUR` | The currency revenue is reported in |

Errors appear next to the field, for example `Enter a domain like example.com, without a path.` The collector caches site settings for up to a minute, so a change to the domain or hostnames takes effect within about a minute.

### How the domain and hostnames decide what is counted

The collector compares the hostname of each page with the site's domain and its additional hostnames. A leading `www.` is ignored on both sides.

* **No additional hostnames**: events from the domain and every subdomain of it are counted. With the domain `example.com`, visits to `example.com`, `www.example.com` and `blog.example.com` all count.
* **One or more additional hostnames**: events from the domain itself and from the exact hostnames in the list are counted. Other subdomains of the domain are no longer accepted, so add each one you use.

Events from any other hostname are dropped without an error. If you serve the site from a second domain, such as a shop on `shop-example.net`, add that hostname here so its visits count.

> [!NOTE]
>
> By default the script ignores pages on `localhost`, `127.0.0.1` and `file://`, whatever the hostname list says. To track them, add `data-allow-localhost` to the script tag. See [localhost and testing](https://docs.crispstats.com/tracking/localhost-and-testing.md).

## Rotate the public key

The public key is the `cs_pk_` value in your script tag's `data-site` attribute. It is safe to publish, because all it can do is send events to this site. Rotate it when someone is sending events you do not want.

**1. Open the public key**

Go to **Settings**, then **Tracking code**, and scroll to **Public key**. You can copy the current key here.

**2. Rotate it**

Select **Rotate key** and confirm. CrispStats issues a new key and shows it in place of the old one.

**3. Replace the key everywhere**

Update every place that uses the old key: the script tag, server-side event code, and the live visitor badge if you use it. Deploy the change.

> [!WARNING]
>
> The old key stops working as soon as the collector refreshes its cache, within about a minute. Until your pages carry the new key, no visits are counted, and visits in that gap cannot be recovered.

## Delete a site

Deleting a site removes the site, its settings, goals, funnels and alerts, and every event recorded for it. The tracking snippet stops counting. This cannot be undone.

**1. Export what you want to keep**

Download your data from **Settings**, **Import and export** first. See [CSV export](https://docs.crispstats.com/share/csv-export.md) and [raw events](https://docs.crispstats.com/share/raw-events.md).

**2. Open the danger zone**

Go to **Settings**, then **Danger zone**, and select **Delete site**.

**3. Confirm with the domain**

Type the site's domain exactly as shown, for example `example.com`, and confirm. The server checks the typed domain again, so a mismatch is refused with `Type example.com exactly to confirm.`

You return to your list of sites. The site's events are removed from storage in the background shortly afterwards. Only owners and admins see the **Delete site** button. Deleting a site frees a place under your plan's site limit.

To start a site's numbers from zero and keep its settings, snippet and payments, [reset its stats](https://docs.crispstats.com/account/reset-stats.md) instead. To move it to another workspace you own, [transfer it](https://docs.crispstats.com/account/transfer-a-site.md).

## Workspaces

A workspace owns sites, members, API keys and the subscription. Everyone in a workspace can open each of its sites, with the permissions of their [role](https://docs.crispstats.com/account/team-and-roles.md).

* When you sign up, CrispStats creates a workspace for you, named after you (for example `Alex's workspace`), with you as its owner and with a 14-day free trial, no card required. Each person gets one trial.
* You join other workspaces by accepting an [invitation](https://docs.crispstats.com/account/team-and-roles.md#invite-someone).
* Plans and limits apply per workspace, not per site or per person. The [Billing screen](https://docs.crispstats.com/account/billing.md) shows one workspace at a time and has a selector when you belong to several.

The workspace page, at [crispstats.com/app/workspace](https://crispstats.com/app/workspace), holds the workspace's [members and invitations](https://docs.crispstats.com/account/team-and-roles.md), its [API keys](https://docs.crispstats.com/account/api-keys.md), its name and its plan. Open it with **Workspace** in the account menu, on your list of sites, or with **Team and API keys** below a site's settings tabs. From inside a site it opens the workspace that owns that site. Owners and admins can rename the workspace there. The dashboard has no screen to create or delete a workspace yet; the only way to create one is to [transfer a site](https://docs.crispstats.com/account/transfer-a-site.md) to a new workspace, which is offered when you own no workspace other than the site's.

Your account page lists every workspace you belong to under **Workspaces**.

## Next steps

> [card] [Invite your team](https://docs.crispstats.com/account/team-and-roles.md)
>
> Add people to the workspace and choose what each role can change.

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

> [card] [Plans and limits](https://docs.crispstats.com/account/plans-and-limits.md)
>
> See how many sites, seats and events each plan includes.


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