Skip to content

Commit 4fdf0d1

Browse files
crazkowardpeet
authored andcommittedAug 27, 2019
feat(gatsby-plugin-google-analytics): better dnt (gatsbyjs#17067)
1 parent 39ef1ef commit 4fdf0d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎packages/gatsby-plugin-google-analytics/src/gatsby-ssr.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const onRenderBody = (
7878
if(${
7979
typeof pluginOptions.respectDNT !== `undefined` &&
8080
pluginOptions.respectDNT == true
81-
? `!(navigator.doNotTrack == "1" || window.doNotTrack == "1")`
81+
? `!(parseInt(navigator.doNotTrack) === 1 || parseInt(window.doNotTrack) === 1 || parseInt(navigator.msDoNotTrack) === 1 || navigator.doNotTrack === "yes")`
8282
: `true`
8383
}) {
8484
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

0 commit comments

Comments
 (0)
Please sign in to comment.