Skip to content

Commit

Permalink
feat(gatsby-plugin-google-analytics): better dnt (#17067)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazko authored and wardpeet committed Aug 27, 2019
1 parent 39ef1ef commit 4fdf0d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-google-analytics/src/gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const onRenderBody = (
if(${
typeof pluginOptions.respectDNT !== `undefined` &&
pluginOptions.respectDNT == true
? `!(navigator.doNotTrack == "1" || window.doNotTrack == "1")`
? `!(parseInt(navigator.doNotTrack) === 1 || parseInt(window.doNotTrack) === 1 || parseInt(navigator.msDoNotTrack) === 1 || navigator.doNotTrack === "yes")`
: `true`
}) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down

0 comments on commit 4fdf0d1

Please sign in to comment.