From a51945ea4b99d17501d73cf3367926683e4a4dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 25 May 2018 14:52:06 +0200 Subject: 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 --- config/privacy/privacyConfig.go | 3 +++ config/privacy/privacyConfig_test.go | 2 ++ 2 files changed, 5 insertions(+) (limited to 'config/privacy') 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) -- cgit v1.2.3