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.
| Build | What is in it | Gzipped |
|---|---|---|
Full (d.js, the default) | Core plus outbound links, downloads, 404 pages, web vitals and errors, each behind its attribute | about 3.8 KB |
Core (d.core.js) | Pageviews, single-page navigation, engagement, custom events, identify and revenue calls | about 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.
| Comparison | Calculation | Share |
|---|---|---|
| Core script vs median mobile page | 2.2 ÷ 2,311 KB | 0.10% |
| Full script vs median mobile page | 3.8 ÷ 2,311 KB | 0.16% |
| Full script vs median mobile JavaScript | 3.8 ÷ 570 KB | 0.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
deferorasyncdoes 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:
- Open the network panel and reload the page with the cache disabled.
- Filter by the script’s domain and read the transferred size of the script itself. That is the compressed size your visitors download.
- Count every request to that domain. Include configuration files and the requests that send data.
- 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.