docs: Add Matomo analytics and privacy message #5173
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.
I've added Matomo analytics to the MKDocs documentation.
https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-analytics/
Matomo was not supported by default, so I created it a custom analytics provider. The site will pop up an Analytics Consent form when a user first visits.
Analytics Consent Form
They can chose to either Accept or Manage settings. If they Accept the form will disappear setting a cookie to
{analytics: true, github: true}
. These cookies job is just to remember the visitors preference, on browsers that don't allow cookies the user will be prompted every time This is default behavior of material mkdocs.Manage Settings View
If the user opts out of Matomo no site usage data is sent to Matomo. If they opt-in the following settings are enabled.
The GitHub cookie controls whether the site will make requests to GitHubs API to load repo statistics.
If the user declines the stats will not show.
If they accept and then decline later the stats will continue to show until the session cache is cleared with the last received data from GitHub.
The analytics consent form text is borrowed from the main https://grass.osgeo.org site and links back to our full privacy policy and other relevant resources.
In compliance with GDPR rules the user has the ability to modify their selections at any time by clicking the newly added Privacy Settings link in the footer.
This link will reopen the Analytics Consent form for users to update their settings.
References
Material Mkdocs
Matomo