-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
Milestone
Description
By default, with the Google Analytics template, we do not respect the browser's "do not track" setting:
hugo/tpl/tplimpl/embedded/templates/google_analytics.html
Lines 9 to 18 in e08d9af
if ({{ site.Config.Privacy.GoogleAnalytics.RespectDoNotTrack }}) { | |
var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack); | |
var doNotTrack = (dnt == "1" || dnt == "yes"); | |
} | |
if (!doNotTrack) { | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', '{{ . }}'); | |
} |
I can't think of a good reason for overriding a visitor's preferences.
I suggest we deprecate this config setting and always respect the visitor's preference.
cc: @chalin
chalin and esacteksab