// Enabling this will make the GA templates respect the
// "Do Not Track" HTTP header. See https://www.paulfurley.com/google-analytics-dnt/.
RespectDoNotTrack bool
+
+ // Enabling this will make it so the users' IP addresses are anonymized within Google Analytics.
+ AnonymizeIP bool
}
// Instagram holds the privacy configuration settings related to the Instagram shortcode.
[privacy.googleAnalytics]
disable = true
respectDoNotTrack = true
+anonymizeIP = true
[privacy.instagram]
disable = true
simple = true
assert.True(pc.Disqus.Disable)
assert.True(pc.GoogleAnalytics.Disable)
assert.True(pc.GoogleAnalytics.RespectDoNotTrack)
+ assert.True(pc.GoogleAnalytics.AnonymizeIP)
assert.True(pc.Instagram.Disable)
assert.True(pc.Instagram.Simple)
assert.True(pc.SpeakerDeck.Disable)
b.Build(BuildCfg{})
// Gheck GA regular and async
- b.AssertFileContent("public/index.html", "'script','https://www.google-analytics.com/analytics.js','ga');\n\tga('create', 'ga_id', 'auto')", "<script async src='//www.google-analytics.com/analytics.js'>")
+ b.AssertFileContent("public/index.html",
+ "'anonymizeIp', true",
+ "'script','https://www.google-analytics.com/analytics.js','ga');\n\tga('create', 'ga_id', 'auto')",
+ "<script async src='//www.google-analytics.com/analytics.js'>")
// Disqus
b.AssertFileContent("public/index.html", "\"disqus_shortname\" + '.disqus.com/embed.js';")
[services.googleAnalytics]
id = "ga_id"
+[privacy]
+[privacy.disqus]
+disable = false
+[privacy.googleAnalytics]
+respectDoNotTrack = true
+anonymizeIP = true
+[privacy.instagram]
+simple = true
+[privacy.speakerDeck]
+[privacy.twitter]
+enableDNT = true
+[privacy.vimeo]
+disable = false
+[privacy.youtube]
+disable = false
+privacyEnhanced = true
+
`
func (s *sitesBuilder) WithSimpleConfigFile() *sitesBuilder {
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
+ {{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
}
</script>
{{ end }}
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
+ {{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
}
</script>
<script async src='//www.google-analytics.com/analytics.js'></script>
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
+ {{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
}
</script>
{{ end }}
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
+ {{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
}
</script>
<script async src='//www.google-analytics.com/analytics.js'></script>