This contains Plausible tracker script and NPM package which Plausible users integrate into their site and which captures pageviews and more.
See also ARCHITECTURE.md
To download dependencies, do
npm install
npx playwright install # installs browsers used by playwrightCompile tracker code by node compile.js.
Use node compile.js --watch to watch for changes.
Use node compile.js --web-snippet if you need to update web snippet code.
Tests can be run in UI mode via npx playwright test --ui. This helps with debugging.
To test changes to the npm package by installing the local version against a test project, we recommend:
- installing yalc via
npm install yalc -g - compiling the tracker
- running
yalc publishintracker/npm_packagedirectory
More instructions can be found in yalc repo.
Handled via PRs. When making tracker changes, it's required to:
- Tag your PR with a
tracker release:label - Update
tracker/CHANGELOG.md
After merge github actions automatically:
- includes the updated tracker scripts in the next cloud deploy
- updates npm package package.json and CHANGELOG.md with the new version
- releases the new package version on NPM.