Skip to main content
There are two builds of the CrispStats script and several URLs that serve them. In short: /d.js is the script, with every optional module. /d.core.js is a smaller build without the optional modules. Every other script URL is one of those two under another name. Use https://in.crispstats.com/d.js unless you have a reason not to. Events go to one of two places, and the tag decides which: POST /e on the standard tag, or POST /p/e behind a proxy, which trusts the visitor address your proxy forwards. POST /api/event is the older proxy route. See the two event endpoints.

Which file is which

The same URL always serves the same build at its current version. There are no version numbers in the URLs. Use the full build unless you want the smallest file and none of the modules. A module that is not switched on does nothing until its attribute is on the tag.

What d.core.js leaves out

The core build ignores these attributes: Everything else works the same in both builds: pageviews, single-page navigation, engagement, custom and declarative events, crispstats.identify(), crispstats.revenue(), crispstats.pageview(), crispstats.id(), and every other attribute. To use the core build, change the file name in src:

The two event endpoints

The script sends every event to <data-api>/e. Which collector route that reaches depends only on where data-api points: All three take the same payload and give the same answers. /e ignores X-Forwarded-For, so nobody can change who a direct visit belongs to. The two proxy routes trust it, because there the connecting address is your server. You never choose between them in the script: the tag’s data-api decides. See the collector reference.

Caching and versions

All the script URLs are served with the same headers: When a new version ships, the URL stays the same and the ETag changes. A browser with a cached copy uses it for up to a day, then fetches the new version in the background and uses it from the next page load. A browser without a copy gets the new version at once. Behind a proxy, the proxy passes Cache-Control and ETag through, so the same rules apply; the Cloudflare Worker example also keeps the file in your zone’s cache for a day. Do not add an integrity attribute to the tag: the file at the same URL changes with each release, and a fixed hash would then block it.

Check the version

crispstats.v holds the version of the script running on the page:
If it is undefined, the script has not loaded, or only the queue stub is on the page. The setup check also returns the current version.

Safe on your page

It never throws

The whole script runs inside a try block, and every entry point, from event listeners to crispstats() and its methods, is wrapped so that an error inside the tracker is swallowed instead of reaching your code. Network failures are ignored too: events are sent with navigator.sendBeacon, or fetch with keepalive when the beacon is missing or refused, and the response is never read. crispstats.id() resolves to undefined rather than rejecting.

Loading it twice is harmless

If the script runs a second time on the same page, for example because it is in both your layout and a tag manager, the second copy sees that window.crispstats already has a version and does nothing. You get one set of pageviews. A global that is not a function, such as an element with id="crispstats", is replaced.

Next steps

Script attributes

Every option the script reads, and the crispstats global.

Proxy the script

Serve either build from your own domain.

Data collected

Exactly what each event contains.
Last modified on November 24, 2026