Repository navigation
feat: add configurable Umami visitor analytics - #20
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add optional Umami visitor analytics to the Usage portal, independently of the opt-in product reports submitted by PicPeak installations.
The tracker records visits and pageviews across the portal's SPA navigation, including browser back/forward. Standard Umami metrics cover referrers, campaigns, browser, device, language and approximate location. Named events count opening the main website, reading schemas and downloading source without delaying navigation or downloads.
Tracking is limited to known page paths. The before-send filter removes access tokens, lookup hashes, URL fragments, non-UTM query parameters, arbitrary event data and user identifiers. External referrers retain only their origin. Do Not Track, Global Privacy Control, Umami's browser opt-out and configured domain restrictions are respected. Analytics failures leave the portal usable. The English and German transparency page explains the separate website statistics.
Configuration
Requires Umami 2.18 or newer. Set
UMAMI_SCRIPT_URLand the portal'sUMAMI_WEBSITE_IDin the container environment.UMAMI_DOMAINSdefaults tousage.picpeak.app. Settings are read at runtime; no frontend rebuild is needed. Both tracking values are empty by default, so tracking remains disabled until configured.The public configuration endpoint exposes only these public tracker settings. CSP permits only the explicitly configured tracker origin for scripts and connections. Invalid configuration fails startup with an actionable error. Deployment variables are included in
.env.exampleandcompose.yaml.Validation
npm run test:required: 125 backend/integration tests and 46 browser tests passed, including PostgreSQL and the same pinned PicPeak client used by CI.