About this project
Simple Analytics Scripts is the open-source source code behind Simple Analytics' public-facing JavaScript tracking scripts. Simple Analytics is a privacy-first web analytics platform that shows page views, referrers, top pages, and device information without using cookies or collecting personal data.
Repository contents:
- `src/default.js` — main script source with conditional feature blocks using custom comment syntax (`/** if variablename **/`), compiled into multiple output variants
- `src/auto-events.js` — auto-event tracking logic
- `compile.js` — build script that generates distribution variants
- `minify.js` — handles minification via UglifyJS
Output variants include `latest.js` (full-featured) and `light.js` (minimal), deployed to the Simple Analytics CDN, custom domains, and the Cloudflare Apps marketplace.
Development workflow:
- Install Node and pnpm at pinned versions
- Run `pnpm install --frozen-lockfile`
- Use `pnpm run watch` for validation and compilation on save
- Use `pnpm run build` before contributing; verify on a live site
- Deploy with `pnpm run deploy` (interactive CLI, dry-run by default)
Testing is performed against a matrix of real browsers and devices sponsored by BrowserStack, with support for vendor-maintained versions and two years post-eol coverage.
License: MIT.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.