Skip to main content
You install CrispStats by adding one script tag to every page of your site. There is no npm package to install: frameworks load the same tag in their own way. From there, pageviews, single-page navigation and time on page are tracked. By default no cookie is set and nothing is stored in the browser. This page helps you pick a method, find your public key and open the guide for your stack.

Choose an install method

The script tag is the shortest path. It looks like this:
Replace cs_pk_xxxxxxxx with your site’s public key and example.com with your domain. data-domains keeps the script quiet on preview deployments, workers.dev copies, staging hosts and scraped copies of your site, so they are not 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.

Find your public key

Every site has a public key that starts with cs_pk_. It tells the collector which site an event belongs to. It is safe to publish: all it can do is send events to that site. You can find it in three places:
  • Settings, Tracking code: the Public key panel shows the key with a copy button, and every snippet on that tab already has the key filled in.
  • The command menu: the Copy tracking snippet action copies the plain script tag for the site you have open.
  • Onboarding: the Install the script step shows the same platform tabs, with the key filled in, right after you add a site.
Owners and admins of the workspace can select Rotate key on the Tracking code tab. A new key is issued and the collector stops accepting the old one, within about a minute because it caches site settings for 60 seconds. From then on no visits are counted until you replace the snippet on your site.

Copy the exact code for your platform

The Tracking code tab in your site settings shows the same script, placed where each platform wants it, with tabs for HTML, Next.js, React and Vite, Vue and Nuxt, Astro, SvelteKit, Remix and React Router, WordPress, Webflow, Framer, Shopify and Google Tag Manager. Each tab says where the code goes, writes data-domains with your site’s domain and additional hostnames, and adds data-keep-params and data-persist when your settings need them. The switches add an attribute to every tab at once: No switch is on by default. Leave Hash routing off for frameworks that route with real paths (Next.js, Nuxt, SvelteKit, Astro, Remix): it only reads routes written after #, such as /#/pricing. The switches only change the snippet you copy. An option starts working once the updated snippet is on your site. Script attributes lists every attribute, including the ones that are not switches.

Platform guides

Plain HTML

Paste the tag in <head> on every page.

Google Tag Manager

A Custom HTML tag on All Pages.

WordPress

A wp_head action in functions.php or a site plugin.

Webflow

Site settings, Custom code, Head code.

Framer

Site settings, General, Custom code.

Shopify

layout/theme.liquid, above </head>.

Wix

Settings, Custom Code, in the head on all pages.

Squarespace

The Header field of Code Injection.

Ghost

Settings, Advanced, Code injection, Site header.

Framework guides

Next.js

next/script in the root layout.

React and Vite

The tag in index.html.

Vue and Nuxt

app.head in nuxt.config.ts.

Astro

The tag with is:inline in your layout.

SvelteKit

The tag in src/app.html.

Remix

The tag in app/root.tsx.

Angular

The tag in src/index.html.

Svelte

The tag in index.html, for Svelte with Vite.

TypeScript

Types for the global and the queue stub.

Static site guides

Gatsby

onRenderBody in gatsby-ssr.js.

Hugo

Your head partial, overriding the theme’s.

Jekyll

_includes/head.html in your site.

Eleventy

The base layout in _includes.

Docusaurus

The scripts array in docusaurus.config.js.

Server framework guides

Laravel

Your Blade layout.

Ruby on Rails

application.html.erb. Turbo is tracked.

Django

base.html.

Flask

Your base Jinja template.

Switching from another tool

Only Plausible history can be imported; from other tools, run both side by side for a while. The switching guides map events and goals across: Google Analytics 4, Plausible, Umami and Fathom.

Confirm the install

Open Settings, Tracking code. The status row at the top checks every few seconds and shows Receiving events. once the first event from your site has been stored. Visits from localhost, *.localhost, 127.x.x.x, [::1], file:// and automated browsers are ignored, so open your deployed site in a normal browser window. To test before you ship, see localhost and testing. If nothing arrives, work through troubleshooting.

Next steps

Install on a plain HTML site

The full procedure, with optional modules and the install check.

Script attributes

Every data- attribute the script reads.

Serve the script from your domain

Count visitors whose ad blocker stops analytics hosts.
Last modified on November 25, 2026