Matomo user tracking and optout scripts for Hugo
Matomo tracking and opt-out scripts offer an effective solution for integrating web analytics into your Hugo-powered site. Designed for users with extended Hugo v0.120.0 or higher, this tool enables seamless tracking capabilities while adhering to privacy regulations through customizable opt-out features. Whether you are a seasoned developer or a beginner, this integration presents an opportunity to enhance your website’s performance insights while maintaining user trust.
By incorporating Matomo’s powerful analytics capabilities, users can acquire valuable data about site interactions without compromising on compliance. The flexibility of customization through simple configuration in the config.toml file makes it easy to tailor the tracking and opt-out messages to fit your site’s brand and aesthetic.
Simple Installation: Easily install as a submodule, requiring minimal setup for quick integration into your Hugo project.
Configuration Flexibility: Customize tracking with your Matomo server URL and site ID directly in the config.toml, making it straightforward to adapt to any project.
Opt-Out Customization: Tailor the opt-out message and button text using markdown support, ensuring clear communication with your visitors.
Compatibility with Legacy Browsers: Supports modern web browsers and retrofits compatibility for older versions like IE11 through the es6-promise polyfill.
Style Control: Incorporate your own CSS styles by overriding the default styles provided, allowing for a cohesive look that matches your site’s design.
Fingerprinting and SRI: Enhanced security features like script fingerprinting and Subresource Integrity (SRI) by default, although they can be disabled based on web hosting needs.
Easy Template Integration: Simply add the tracking partial to your Hugo templates, such as in footer.html, ensuring a clean and efficient codebase.