diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-05-25 14:52:06 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-05-25 15:56:10 +0200 |
commit | a51945ea4b99d17501d73cf3367926683e4a4dfd (patch) | |
tree | 730552e112274a2cdc3c3e0f1b1ff2f365107d81 /config | |
parent | 7b9dbef41acfc619754d5a2a342a00e37f6f96e0 (diff) |
Add no-cookie variants of the Google Analytics templates
The current full set of options for GA is now:
```toml
[privacy]
[privacy.googleAnalytics]
disable = false
respectDoNotTrack = true
anonymizeIP = true
useSessionStorage = true
```
Fixes #4775
Diffstat (limited to 'config')
-rw-r--r-- | config/privacy/privacyConfig.go | 3 | ||||
-rw-r--r-- | config/privacy/privacyConfig_test.go | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/config/privacy/privacyConfig.go b/config/privacy/privacyConfig.go index 6dad54e72..e7bb1e25c 100644 --- a/config/privacy/privacyConfig.go +++ b/config/privacy/privacyConfig.go @@ -45,6 +45,9 @@ type Disqus struct { type GoogleAnalytics struct { Service `mapstructure:",squash"` + // Enabling this will disable the use of Cookies and use Session Storage to Store the GA Client ID. + UseSessionStorage bool + // Enabling this will make the GA templates respect the // "Do Not Track" HTTP header. See https://www.paulfurley.com/google-analytics-dnt/. RespectDoNotTrack bool diff --git a/config/privacy/privacyConfig_test.go b/config/privacy/privacyConfig_test.go index 7e736ce96..72ffb5467 100644 --- a/config/privacy/privacyConfig_test.go +++ b/config/privacy/privacyConfig_test.go @@ -35,6 +35,7 @@ disable = true disable = true respectDoNotTrack = true anonymizeIP = true +useSessionStorage = true [privacy.instagram] disable = true simple = true @@ -61,6 +62,7 @@ simple = true assert.True(pc.GoogleAnalytics.Disable) assert.True(pc.GoogleAnalytics.RespectDoNotTrack) assert.True(pc.GoogleAnalytics.AnonymizeIP) + assert.True(pc.GoogleAnalytics.UseSessionStorage) assert.True(pc.Instagram.Disable) assert.True(pc.Instagram.Simple) assert.True(pc.SpeakerDeck.Disable) |