Skip to content

Lightweight analytics: a script that adds almost nothing to your page

Core script
about 2.2 KB gzipped
With every optional module
about 3.8 KB gzipped
<script defer src="https://in.crispstats.com/d.js" data-site="YOUR_SITE_KEY"></script>
The tracking script's gzipped size, from its build, and the one line that adds it.

Lightweight analytics is a tracking script small enough that it has no measurable effect on how fast your pages load: a few kilobytes, loaded without blocking, sending one small request per page. The CrispStats script is about 3.8 KB gzipped with every optional module included, or about 2.2 KB for the core build without them, and the build fails if either grows past its budget.

Every feature on every plan and in the 14-day free trial. Updated

What the few kilobytes do

  • Pageviews, sources and engagement in the core

    Realtime
    The about 2.2 KB core counts pageviews, single-page navigation, time on page and scroll depth, with no cookies.
  • Web vitals as an option

    Web vitals
    Turn on the vitals module and LCP, INP and CLS are measured from real visits, so you can check that your own pages stay fast.
  • JavaScript errors as an option

    Error tracking
    The errors module reports uncaught errors and unhandled rejections, at most 10 per page load, each distinct error once.
  • The rest of the work happens on the server

    Revenue attribution
    Channel classification, bot filtering, location and revenue matching all run at the edge and in the backend, not in your visitor’s browser.

Views in the tiles come from the demo site, Quillbook, on generated traffic. Prices are the demo company's.All of it is on every plan and in the 14-day free trial.

On this page
  1. How big is the script?
  2. How much does a few kilobytes matter?
  3. Is script size the whole story?
  4. How do you measure an analytics script's weight?
  5. What does a lightweight script give up?

How big is the script?

The script ships in two builds. The default snippet loads the full one, where the optional modules are included but only run when you switch them on with an attribute on the script tag. If you never use them, the core build is smaller still.

Sizes from the tracker build, which fails over budget
BuildWhat is in itGzipped
Full (d.js, the default)Core plus outbound links, downloads, 404 pages, web vitals and errors, each behind its attributeabout 3.8 KB
Core (d.core.js)Pageviews, single-page navigation, engagement, custom events, identify and revenue callsabout 2.2 KB

Installing it is one tag, loaded with defer so it never blocks rendering:

<script defer src="https://in.crispstats.com/d.js" data-site="YOUR_SITE_KEY"></script>

How much does a few kilobytes matter?

Put the size next to a typical page. HTTP Archive’s Web Almanac 2024 page weight chapter measured the median mobile page at 2,311 KB in its October 2024 crawl, with 570 KB of that as JavaScript.

A worked example with the Web Almanac 2024 medians
ComparisonCalculationShare
Core script vs median mobile page2.2 ÷ 2,311 KB0.10%
Full script vs median mobile page3.8 ÷ 2,311 KB0.16%
Full script vs median mobile JavaScript3.8 ÷ 570 KB0.67%

Under one percent of the JavaScript on a median page is noise next to an image or a font. That is the point of a lightweight script: it should never be the reason a page is slow.

Is script size the whole story?

No. Bytes are the easy number to compare, but four other things decide whether analytics slows a page:

  • Blocking. A script loaded with defer or async does not hold up rendering. One loaded synchronously in the head does, whatever its size.
  • Extra requests. Some tools load a second script, a configuration file or a tag manager first. Each adds a round trip.
  • Main-thread work. Listening to every click and mouse move, as replay and heatmap tools do, costs more CPU than counting a pageview. That shows up in INP.
  • When data is sent. Engagement here is sent when the page is hidden or left, not on a timer, so an open tab does not keep sending requests.

How do you measure an analytics script’s weight?

You do not need to trust anyone’s number, ours included. In any browser’s developer tools:

  1. Open the network panel and reload the page with the cache disabled.
  2. Filter by the script’s domain and read the transferred size of the script itself. That is the compressed size your visitors download.
  3. Count every request to that domain. Include configuration files and the requests that send data.
  4. Record a performance profile and look for long tasks that start inside the script.

Then check the effect on real users rather than a lab score. The web vitals report shows LCP, INP and CLS at the 75th percentile by page, so you can see whether any script change moved them. Core Web Vitals in plain English explains the thresholds.

What does a lightweight script give up?

A few kilobytes cannot record sessions or draw heatmaps, and this one does not try: there is no session replay, heatmap, A/B testing or feature flag code in it. If you need those, the tool that provides them will be heavier, and that is a fair trade to make knowingly.

Topic questions. Straight answers.

What people ask about this part of analytics.

  • Loaded with defer, it does not block rendering, so it should not move LCP or CLS. It does little work on the main thread, which keeps INP unaffected. Measure it on your own pages with the vitals report to be sure.

  • The default full build carries optional modules such as outbound links, downloads, web vitals and errors, each switched on by an attribute. Sites that only need pageviews, sources and events can load the smaller core build instead.

  • Yes. A first-party proxy serves the script and receives events on your own domain, which avoids a third-party connection and keeps it working with some ad blockers.

  • No. Nothing is written to the device unless you switch on the opt-in persistent visitors mode, so there is no cookie to manage and no consent prompt to load alongside it. Visitors are counted with a hash that rotates daily, computed on the server.

Not answered here? Write to hello@crispstats.com

Go further

Read more

  • Core Web Vitals in plain English

    What LCP, INP and CLS measure, the good and poor thresholds for each, why the 75th percentile matters, and the fixes that usually move them.

  • Web vitals

    LCP, INP and CLS measured on real visits, by page and device.

  • Cookieless analytics

    Cookieless analytics counts visitors with a daily rotating hash instead of a cookie.

  • Web analytics for developers

    A small cookieless script with web vitals and error tracking, an npm SDK, a REST API and an MCP server, so your analytics fits the way you work.

Your traffic, crisp and clear

One script, no cookies, and every feature from the first day. Set up takes about as long as pasting a snippet.