Closed ndorfin closed 7 years ago
To be honest I haven't done DNT before - the MDN article you link to does note it's an experimental technology - are there any browser compatibility issues we might come across?
Should be fine though
With this polyfill:
function DNT () {
if ('msDoNotTrack' in navigator) return navigator.msDoNotTrack;
if ('doNotTrack' in window) return window.doNotTrack;
if ('doNotTrack' in navigator) return navigator.doNotTrack;
return 0;
};
…we're saying: If your browser doesn't support DNT, then we'll set your DNT policy to 0 (or Track me by default). But if your browser does support DNT, through one of the 3 APIs we check for, then we'll check what your DNT status is. If DNT is 1, we don't load GA. If DNT is 0 (default) we'll load GA.
Right - should be fine then - let's put it up
This PR:
See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack