The website counts visits and downloads with Umami, and says so on a privacy page #61

Merged
eliott merged 4 commits from chore/site-analytics into main 2026-11-23 19:19:51 +01:00
Owner

The website now counts visits with the project's self-hosted Umami, along with clicks on the download buttons and copied commands. A new privacy page, linked from every page's footer, says what is counted and logged. Nothing changes for anyone using the scanner or the app.

How it works

  • site/scripts/analytics.mjs holds the Umami script tag. Starlight's head loads it on the docs and the other Starlight pages, and src/layouts/Site.astro on the home page. data-domains="scan.roll-note.com" keeps pnpm dev and pnpm preview out of the numbers.
  • Download page events:
    • download (with system and file) on each download button;
    • build-from-source on the macOS card's button;
    • copy-command (with system, or source for the build commands) when a code block's copy button is used, from a small script on the page.
  • /privacy/ covers what Umami keeps (no cookie, no IP address kept, nothing across sites), the server's request logs (deleted after 30 days), and that the app only asks Forgejo for the latest release.
  • site/README.md has a "Visits" section: where the id lives, the CSP the reverse proxy must allow (https://umami.eliottbidault.fr in script-src and connect-src), and that the privacy page must change along with what is counted.

Tested

  • pnpm build, pnpm check and pnpm lint pass.
  • The script tag is in the built home, download, docs and privacy pages; the download buttons carry their event attributes.
  • In a browser, with a stand-in for window.umami, the copy buttons sent copy-command with debian, linux and source.

Not tested

  • No real event reached Umami: the domain filter keeps the local preview out. To check after deploying, look in the Umami dashboard.
  • The copy-tracking script is inline in the page, like Astro's and Starlight's own four. It passes a CSP that allows those; a CSP that allows inline scripts by hash needs its hash.

Changes in behaviour

  • None in the app. If #59's pull request (0.12.0) is merged first, this branch needs rebasing and its version raising to 0.12.1: the two conflict only on the version number.
The website now counts visits with the project's self-hosted Umami, along with clicks on the download buttons and copied commands. A new privacy page, linked from every page's footer, says what is counted and logged. Nothing changes for anyone using the scanner or the app. ## How it works - `site/scripts/analytics.mjs` holds the Umami script tag. Starlight's `head` loads it on the docs and the other Starlight pages, and `src/layouts/Site.astro` on the home page. `data-domains="scan.roll-note.com"` keeps `pnpm dev` and `pnpm preview` out of the numbers. - Download page events: - `download` (with `system` and `file`) on each download button; - `build-from-source` on the macOS card's button; - `copy-command` (with `system`, or `source` for the build commands) when a code block's copy button is used, from a small script on the page. - `/privacy/` covers what Umami keeps (no cookie, no IP address kept, nothing across sites), the server's request logs (deleted after 30 days), and that the app only asks Forgejo for the latest release. - `site/README.md` has a "Visits" section: where the id lives, the CSP the reverse proxy must allow (`https://umami.eliottbidault.fr` in `script-src` and `connect-src`), and that the privacy page must change along with what is counted. ## Tested - `pnpm build`, `pnpm check` and `pnpm lint` pass. - The script tag is in the built home, download, docs and privacy pages; the download buttons carry their event attributes. - In a browser, with a stand-in for `window.umami`, the copy buttons sent `copy-command` with `debian`, `linux` and `source`. ## Not tested - No real event reached Umami: the domain filter keeps the local preview out. To check after deploying, look in the Umami dashboard. - The copy-tracking script is inline in the page, like Astro's and Starlight's own four. It passes a CSP that allows those; a CSP that allows inline scripts by hash needs its hash. ## Changes in behaviour - None in the app. If #59's pull request (0.12.0) is merged first, this branch needs rebasing and its version raising to 0.12.1: the two conflict only on the version number.
- scripts/analytics.mjs holds the script tag, loaded by Starlight's head and the home page's layout.
- Only scan.roll-note.com is counted (data-domains), not pnpm dev or preview.
- Download buttons carry data-umami-event attributes; a copied command is tracked per system.
docs(site): the privacy page says the server logs are deleted after 30 days
Some checks are pending
website / build (pull_request) Waiting to run
app / linux (pull_request) Successful in 5m43s
app / windows (pull_request) Successful in 2m57s
parity / parity (pull_request) Has started running
9277ea7ddc
eliott merged commit 47dab6137f into main 2026-11-23 19:19:51 +01:00
eliott deleted branch chore/site-analytics 2026-11-23 19:19:51 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
RollNote/rollscan!61
No description provided.