Frontend support for Matomo analytics
Onion Launchpad implementation of Matomo analytics according to this proposal.
The feature MUST be disabled by default, and enabled only if some environment variables are set (like the analytics endpoint and a site ID/key).
Services operators MUST be recommended to host the backend only behind an HTTPS proxy without IP logging (and without passing the source IP to the backend, so if there's any backend vulnerability it won't be possible to attackers to discover user's IP addresses). Or even better: leave the backend behind an Onion Service.
There MUST be a consent UX informing users what and how it's collected, and asking for authorization. No cookies should reside in the client machine.
Plug the Clean Insights JS SDK or the Matomo JS SDK into Onion Launchpad.
Enable the metrics collection only if explicitly set by an environment variable during build time.
Implement a consent UX.
Implement the page hits collection.
Document the analytics collection threat model (subsection "Landing page metrics" of this link/comment).
This ticket covers:
- Basic functionality without censorship protection for the metrics system.
- Description: in this phase, the whole implementation is completed.
This ticket does not cover:
- The backend development.
- Implementing censorship protection for the metrics system.
- Content and styling for the consent UX (handled in a distinct ticket).