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

# Filter, change dates and compare periods in CrispStats

> Change the date range, chart interval and comparison period in CrispStats, add filters with is, is not and contains, and share any view through its URL.

The top bar of every CrispStats analytics screen has three controls: the date range, **Compare** and **Filter**. They apply to the screen you are on and carry over when you move to another analytics screen, and the whole state lives in the URL, so any view can be bookmarked or sent to a teammate as a link.

The controls appear on Overview, Revenue, Visitors, Funnels, Events, Retention, Performance, Errors and AI traffic. Realtime, Uptime, Ask AI, Alerts and Settings do not use them.

## Change the date range

**1. Open the date range**

Select the date range button in the top bar, or press `d`.

**2. Pick a preset or two days**

Select a preset to apply it at once. To pick a custom range, select a start day and an end day on the calendar, in either order. The range applies on the second pick.

| Preset | Range | URL value |
| - | - | - |
| Today | Since midnight today | `today` |
| Yesterday | The whole of yesterday | `yesterday` |
| Last 24 hours | The last 24 hours up to now | `24h` |
| Last 7 days | Today and the 6 days before | `7d` |
| Last 30 days | Today and the 29 days before. This is the default. | `30d` |
| Last 90 days | Today and the 89 days before | `90d` |
| Month to date | Since the first of this month | `mtd` |
| Last month | The whole of last month | `last_month` |
| Year to date | Since January 1 | `ytd` |
| Last 12 months | Since the first day of the month 11 months ago | `12m` |
| All time | Everything since January 1, 2020 | `all` |

Presets and custom ranges use UTC calendar days, so "today" starts at midnight UTC. A custom range includes both the start and the end day.

The calendar is keyboard friendly: arrow keys move by day and week, `Home` and `End` jump to the ends of the week, `Page Up` and `Page Down` change month (with `Shift`, year), `Enter` or `Space` picks a day and `Esc` closes the picker.

You can also pick a preset from the command menu: press `Cmd` `K` (or `Ctrl` `K`) and type the preset name. See [keyboard shortcuts](https://docs.crispstats.com/dashboard/keyboard-shortcuts.md).

## Change the chart interval

The traffic chart on the overview groups data into buckets. CrispStats picks a bucket size from the range:

| Range length | Default interval |
| - | - |
| Up to 2 days | Hour |
| Up to 92 days | Day |
| Up to 366 days | Week |
| Longer | Month |

The **Chart interval** control above the chart lets you switch when more than one size fits the range. A size you choose is stored as `g` in the URL and is reset when you change the range, because a bucket size chosen for one range rarely suits another.

## Compare with an earlier period

Select **Compare** in the top bar and choose:

* **Previous period**: the same length of time right before the current range. For **Last 30 days**, that is the 30 days before.
* **Previous year**: the same dates one year earlier.
* **No comparison**: turns comparison off.

With comparison on, KPI tiles show the change, the chart draws the comparison period as a dashed line, and tables such as the [details table](https://docs.crispstats.com/dashboard/overview.md#details-table) and the [events table](https://docs.crispstats.com/dashboard/events.md) add a **Change** column.

## Add a filter

Filters narrow every number on the screen to the visits that match.

**1. Open the filter builder**

Select **Filter** in the top bar, or press `f`.

**2. Choose a dimension**

Type to search, or browse the groups: Page, Source, Location, Device, Campaign and Event. Press `Enter` to take the first match.

**3. Choose an operator and a value**

Choose **is**, **is not** or **contains**, then type a value or pick a suggestion. Suggestions are the most common values of that dimension in the current range, with their visitor counts.

You can also add a filter by selecting a row in any breakdown card, the details table, a goal or an event. That adds an **is** filter, and selecting the same row again removes it.

### Dimensions

| Group | Dimensions |
| - | - |
| Page | Page, Entry page, Exit page, Hostname |
| Source | Channel, Source, Referrer, AI assistant |
| Location | Country, Region, City, Language |
| Device | Device, Browser, OS |
| Campaign | Campaign (`utm_campaign`), UTM source, UTM medium, UTM term, UTM content |
| Event | Event |

### How filters match

* **Filters select visits.** A filter keeps whole sessions that match. A **Page** filter keeps sessions that viewed a matching page, and an **Event** filter keeps sessions that sent a matching custom event, so the other pages and events of those sessions still count.
* **Matching ignores case.** `/Pricing` and `/pricing` match the same pages.
* **contains** matches anywhere in the value. `page contains /blog` keeps sessions that viewed any page whose path includes `/blog`.
* **Combining filters.** Filters on different dimensions must all match. Two **is** or two **contains** filters on the same dimension match if either one does: two **contains** filters on Page keep sessions that match either one. Two **is not** filters on the same dimension exclude both values.
* **One exact value per dimension.** Adding a second **is** filter on a dimension, from the filter builder or from a row, replaces the first, because one value cannot equal two different values. To match several exact values, edit the URL and repeat the `f` parameter.

Active filters show as chips under the top bar, such as **Country is Germany**. Select the cross on a chip to remove that filter. With two or more filters, **Clear all** removes every filter.

## Share a view with its URL

Every control writes to the URL, and CrispStats renders the screen from it. Copy the address bar, use **Copy link to this view** in the command menu, or use the download menu on the overview, and the link opens the same view for anyone with access to the site.

| Parameter | Meaning | Example |
| - | - | - |
| `range` | A preset id from the table above, or `custom`. Left out for the default, `30d`. | `range=7d` |
| `from`, `to` | First and last day of a custom range, as `YYYY-MM-DD`. Both days are included. | `range=custom&from=2026-10-01&to=2026-10-31` |
| `compare` | `previous` or `year`. Left out when comparison is off. | `compare=previous` |
| `g` | Chart interval: `hour`, `day`, `week` or `month`. Left out when it is the default for the range. | `g=week` |
| `f` | A filter as `dimension:operator:value`. Repeat it for several filters. | `f=country:is:DE&f=page:contains:/blog` |

Filter dimensions in the URL are `page`, `entry_page`, `exit_page`, `hostname`, `channel`, `source`, `referrer`, `ai_assistant`, `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `country`, `region`, `city`, `language`, `browser`, `os`, `device` and `event`. Operators are `is`, `is_not` and `contains`. A filter with an unknown dimension or operator, or with an empty value, is ignored.

Screens also keep their own state in the URL, such as the overview's card tabs or the visitors list's segment. Moving to another screen with the sidebar, the command menu or a `g` shortcut keeps the range, comparison and filters and drops the other screen's own parameters.

> [!NOTE]
>
> Saved views are not available in the dashboard yet. To return to a view, bookmark its URL.

## Next steps

> [card] [Read the overview](https://docs.crispstats.com/dashboard/overview.md)
>
> What each tile, card and table on the overview shows.

> [card] [Keyboard shortcuts](https://docs.crispstats.com/dashboard/keyboard-shortcuts.md)
>
> Open the date range and filter builder without the mouse.

> [card] [Share a public dashboard](https://docs.crispstats.com/share/public-dashboard.md)
>
> Give people outside your team a read-only link.


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