feat: add Matomo analytics tracking
Tracking features: - Matomo analytics integration (site ID: 4) - Initial pageview tracking on load - HTMX language change tracking as virtual pageviews - Link tracking enabled for outbound clicks Security updates: - Update CSP to allow matomo.drolo.club for script-src and connect-src - Matomo script loaded asynchronously Implementation: - Added Matomo tracking code before </body> - Track HTMX navigation events (language changes) - Preserve privacy with self-hosted Matomo instance
This commit is contained in:
@@ -30,11 +30,11 @@ func SecurityHeaders(next http.Handler) http.Handler {
|
||||
|
||||
// Content Security Policy (comprehensive)
|
||||
csp := "default-src 'self'; " +
|
||||
"script-src 'self' 'unsafe-inline' https://unpkg.com https://code.iconify.design; " +
|
||||
"script-src 'self' 'unsafe-inline' https://unpkg.com https://code.iconify.design https://matomo.drolo.club; " +
|
||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; " +
|
||||
"font-src 'self' https://fonts.gstatic.com; " +
|
||||
"img-src 'self' data: https:; " +
|
||||
"connect-src 'self' https://api.iconify.design; " +
|
||||
"connect-src 'self' https://api.iconify.design https://matomo.drolo.club; " +
|
||||
"frame-ancestors 'self'; " +
|
||||
"base-uri 'self'; " +
|
||||
"form-action 'self'"
|
||||
|
||||
Reference in New Issue
Block a user