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

# Switch from Google Analytics 4 to CrispStats

> Move from Google Analytics 4 to CrispStats: run both side by side, map gtag events, key events and channels, and know what does not carry over.

To switch from Google Analytics 4, add the CrispStats script next to your GA4 tag, run both for a while, move your events and key events across, then remove GA4 when you trust the new numbers. CrispStats cannot import GA4 data, so your CrispStats history starts on the day you install the script.

This page maps GA4 concepts to CrispStats ones, explains why the two will not show the same numbers, and lists what does not carry over.

## Run both side by side

**1. Add the CrispStats script**

Keep your GA4 tag and add the CrispStats tag to every page. Follow the guide for your stack in [install](https://docs.crispstats.com/install/overview.md). If GA4 loads through Google Tag Manager, you can load CrispStats there too: see [Google Tag Manager](https://docs.crispstats.com/install/google-tag-manager.md).

The two do not interfere: CrispStats uses its own global, `crispstats`, sets no cookie and stores nothing on the device by default.

**2. Send your events to both**

Where your code calls `gtag("event", …)`, add the matching `crispstats(…)` call next to it. See the mapping below.

**3. Recreate key events as goals**

For each GA4 key event, add a CrispStats [goal](https://docs.crispstats.com/dashboard/goals.md) on the same event name or page path. Goals count from data already stored, so a goal added later still covers every event since install.

**4. Compare for at least a full week**

Compare trends, not exact totals: which pages lead, which channels grow, which campaigns convert. A full week covers both weekdays and weekends.

**5. Remove GA4 when you are ready**

Remove the GA4 tag (or its GTM tag) and the `gtag` calls. Export anything you want to keep from GA4 first, because CrispStats cannot read it.

## What maps to what

| Google Analytics 4 | CrispStats | Notes |
| - | - | - |
| Users | Visitors | A visitor is a daily anonymous id, not a cookie. Someone who returns on another day counts again, unless you turn on [persistent visitors](https://docs.crispstats.com/privacy/persistent-visitors.md). |
| Sessions | Sessions | Both end after 30 minutes without activity by default. A CrispStats session also ends when the visitor returns through a different referrer or campaign. |
| Views | Pageviews | Single-page navigation counts in both. In CrispStats the same URL twice in a row is one pageview. |
| Engagement rate and bounce rate | Bounce rate | GA4 calls a session engaged when it lasts longer than 10 seconds, has a key event or has 2 or more page views. A CrispStats session bounces when it has at most one pageview and no custom events, with no time threshold. See [metrics](https://docs.crispstats.com/concepts/metrics.md#bounce-rate). |
| `gtag("event", "sign_up", { method: "email" })` | `crispstats("sign_up", { method: "email" })` | Properties are a flat object. Strings are cut to 500 characters, up to 40 properties per event. |
| Key events | [Goals](https://docs.crispstats.com/dashboard/goals.md) | A goal is an event or a page path, with an optional value per completion. |
| `purchase` and ecommerce revenue | [Revenue](https://docs.crispstats.com/revenue/overview.md) | Connect your payment provider with a key (Stripe, Polar, Paddle, Dodo Payments, Creem, Whop, Razorpay, Lemon Squeezy, Shopify, RevenueCat, Superwall, App Store or Shopify App Store) or report payments with the [payment API](https://docs.crispstats.com/revenue/payment-api.md). Revenue is credited to the first touch. |
| Default channel group | [Channels](https://docs.crispstats.com/concepts/metrics.md#traffic-channels) | Rules for paid, email, affiliate, display, organic search, social, video, referral and direct, plus a separate channel for AI assistants such as ChatGPT and Perplexity. |
| UTM parameters | UTM parameters | The script keeps `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `ref`, `source` and `via`, and cuts other query parameters before sending. Ad click ids such as `gclid` are kept by name only. |

## Why the numbers will differ

Expect CrispStats and GA4 to disagree, sometimes by a lot. The main reasons:

* **Consent.** Where your site asks for consent before loading GA4, visitors who decline are missing from GA4. CrispStats sets no cookie by default, so if it loads for every visitor it sees visits that GA4 does not. See [compliance](https://docs.crispstats.com/privacy/compliance.md) for what it collects. This is not legal advice.
* **Bots.** CrispStats drops self-identified bots, headless browsers and AI crawlers before counting. See [bot filtering](https://docs.crispstats.com/privacy/bot-filtering.md).
* **Visitors.** A CrispStats visitor id lasts one day, so a weekly visitor count is higher than a cookie-based one for people who return on several days.
* **Ad blockers.** Blockers do not treat every tool the same. A [first-party proxy](https://docs.crispstats.com/tracking/proxy.md) counts CrispStats visitors whose blocker stops analytics hosts.

[Why do my numbers differ](https://docs.crispstats.com/help/faq.md#why-do-my-numbers-differ-from-another-analytics-tool) lists every rule.

## What does not carry over

* **Your history.** CrispStats does not import data from GA4. Keep a GA4 export if you need past numbers. The only tool it imports from is [Plausible](https://docs.crispstats.com/switch/import-from-plausible.md).
* **App analytics.** CrispStats tracks websites and server-side events. It has no iOS or Android SDK.
* **Session replay, heatmaps, A/B tests and surveys.** CrispStats does not offer them.
* **Reports tied to Google's other products.** Anything GA4 draws from links to other Google products stays in GA4.

## FAQ

> [accordion] Can I import my Google Analytics data?
>
> No. CrispStats has no import from GA4. Your CrispStats history starts when you install the script, which is why running both side by side for a while helps.

> [accordion] Do I still need a cookie banner after removing GA4?
>
> CrispStats sets no cookie and stores nothing on the device by default. Whether you still need a banner depends on the other tools on your site and on the law that applies to you. See [compliance](https://docs.crispstats.com/privacy/compliance.md). This is not legal advice.

> [accordion] Is it safe to run both scripts on the same page?
>
> Yes. They use different globals and send to different hosts. Each counts the visit on its own.

## Next steps

> [card] [Install the script](https://docs.crispstats.com/install/overview.md)
>
> Find the guide for your stack.

> [card] [Custom events](https://docs.crispstats.com/track/custom-events.md)
>
> Send the actions you tracked with gtag.

> [card] [CrispStats and Google Analytics](https://crispstats.com/vs/google-analytics)
>
> The side-by-side comparison on crispstats.com.

> [!NOTE]
>
> Facts about Google Analytics 4 are from Google's own documentation, read on 2026-11-23: the `gtag("event", …)` syntax and recommended events from [https://developers.google.com/analytics/devguides/collection/ga4/events](https://developers.google.com/analytics/devguides/collection/ga4/events), engaged sessions, engagement rate and bounce rate from [https://support.google.com/analytics/answer/12195621](https://support.google.com/analytics/answer/12195621), and the default 30-minute session timeout from [https://support.google.com/analytics/answer/9191807](https://support.google.com/analytics/answer/9191807).


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