diff --git a/common/head_tag.html b/common/head_tag.html index da29dcb..c5ed128 100644 --- a/common/head_tag.html +++ b/common/head_tag.html @@ -33,6 +33,14 @@ _paq.push(["setDomains", allDomains]); } + if (settings.do_not_track) { + _paq.push(["setDoNotTrack", true]); + } + + if (settings.disable_cookies) { + _paq.push(["disableCookies"]); + } + _paq.push(["setCustomUrl", url]); _paq.push(["setDocumentTitle", title]); _paq.push(["trackPageView"]); diff --git a/settings.yml b/settings.yml index 37a2a94..f9309b2 100644 --- a/settings.yml +++ b/settings.yml @@ -17,3 +17,11 @@ subdomain_tracking: type: bool default: false description: Track visitors across main domain & subdomains, assuming discourse is on a subdomain. +do_not_track: + type: bool + default: false + description: So tracking requests will not be sent if visitors do not wish to be tracked. +disable_cookies: + type: bool + default: false + description: Disables all first party cookies. Existing Matomo cookies for this website will be deleted on the next pageview.