Frontend support for Matomo analytics
Onion Launchpad implementation of Matomo analytics according to this proposal.
Requirements
-
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). -
There MUST be documentation stating that this feature, even with a better configuration in terms of privacy, could still be a point of collecting access data without passing to the Tor network for better anonymization. And also would rely on additional JavaScript code embedded in the landing page. -
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.
Implementation details
-
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).
Scope
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).
Edited by Silvio Rhatto