summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-05-25 10:53:39 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-05-25 10:53:39 +0200
commit1f1d955b56471e41d5288c57f1ef8333dc297120 (patch)
tree62861fc8be43b2be7790ef868632dc073c6d2840 /config
parentffcf26e68cac843f8b257ee72f0282f405ad04a8 (diff)
Add anonymizeIP to GA privacy config
See #4751
Diffstat (limited to 'config')
-rw-r--r--config/privacy/privacyConfig.go3
-rw-r--r--config/privacy/privacyConfig_test.go2
2 files changed, 5 insertions, 0 deletions
diff --git a/config/privacy/privacyConfig.go b/config/privacy/privacyConfig.go
index 9c2a8df66..33e98754c 100644
--- a/config/privacy/privacyConfig.go
+++ b/config/privacy/privacyConfig.go
@@ -48,6 +48,9 @@ type GoogleAnalytics struct {
// 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.
diff --git a/config/privacy/privacyConfig_test.go b/config/privacy/privacyConfig_test.go
index 6b07ef7e6..112e45988 100644
--- a/config/privacy/privacyConfig_test.go
+++ b/config/privacy/privacyConfig_test.go
@@ -34,6 +34,7 @@ disable = true
[privacy.googleAnalytics]
disable = true
respectDoNotTrack = true
+anonymizeIP = true
[privacy.instagram]
disable = true
simple = true
@@ -59,6 +60,7 @@ 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)