From 666f5ea1bec1aa1f155f559a616cae15a4249c23 Mon Sep 17 00:00:00 2001 From: Jonathan Starck Date: Fri, 1 Jun 2018 10:40:13 +0200 Subject: [PATCH 1/5] [FEATURE] Add Google Analytics Opt-Out for GDPR Add 'services.googleAnalytics.optoutCode = 0' to enable the Opt-Out-Code via Constants Editor --- Configuration/TypoScript/constants.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Configuration/TypoScript/constants.txt b/Configuration/TypoScript/constants.txt index 77a3922..9c3c74f 100644 --- a/Configuration/TypoScript/constants.txt +++ b/Configuration/TypoScript/constants.txt @@ -127,7 +127,9 @@ plugin.metaseo { services.googleAnalytics.domainName = # cat=plugin.metaseo.services/page/08; type=boolean; label= Google Analytics Anonymize IP: Enable anonymize IP services.googleAnalytics.anonymizeIp = 0 - # cat=plugin.metaseo.services/page/09; type=boolean; label= Google Analytics Track Downloads: Track downloads (with javascript) (BETA!) + # cat=plugin.metaseo.services/page/09; type=boolean; label= Google Analytics Opt-Out-Code: Enable Opt-Out-Code + services.googleAnalytics.optoutCode = 0 + # cat=plugin.metaseo.services/page/10; type=boolean; label= Google Analytics Track Downloads: Track downloads (with javascript) (BETA!) services.googleAnalytics.trackDownloads = 0 # cat=plugin.metaseo.services/page/11; type=string; label= Piwik URL: Url to your piwik installation (eg. www.example.com/piwik/ - don't use http:// or https:// as prefix!) From 5530a625ecfe6ad64e673d304fa6d39e600d984d Mon Sep 17 00:00:00 2001 From: Jonathan Starck Date: Fri, 1 Jun 2018 10:46:17 +0200 Subject: [PATCH 2/5] [FEATURE] Add Google Analytics Opt-Out for GDPR Add Constant to Typoscript Add Variable 'gaOptOutCode' to FLUIDTEMPLATE --- Configuration/TypoScript/setup.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Configuration/TypoScript/setup.txt b/Configuration/TypoScript/setup.txt index eda0341..4cb2b31 100644 --- a/Configuration/TypoScript/setup.txt +++ b/Configuration/TypoScript/setup.txt @@ -376,6 +376,8 @@ plugin.metaseo { anonymizeIp = {$plugin.metaseo.services.googleAnalytics.anonymizeIp} domainName = {$plugin.metaseo.services.googleAnalytics.domainName} + + optoutCode = {$plugin.metaseo.services.googleAnalytics.optoutCode} trackDownloads = {$plugin.metaseo.services.googleAnalytics.trackDownloads} trackDownloadsScript = EXT:metaseo/Resources/Public/Frontend/JavaScript/GoogleAnalyticsTrackDownload.js @@ -398,10 +400,13 @@ plugin.metaseo { gaIsAnonymize = TEXT gaIsAnonymize.field = gaIsAnonymize - + gaDomainName = TEXT gaDomainName.field = gaDomainName + gaOptOutCode = TEXT + gaOptOutCode.field = gaOptOutCode + gaUseUniversalAnalytics = TEXT gaUseUniversalAnalytics.field = gaUseUniversalAnalytics } From 3d8be9f85e1c3dabc981c245201e8cf0eac60a23 Mon Sep 17 00:00:00 2001 From: Jonathan Starck Date: Fri, 1 Jun 2018 13:04:16 +0200 Subject: [PATCH 3/5] [FEATURE] Add Google Analytics Opt-Out-Code for GDPR Add $this->cObj->data['gaOptOutCode'] = (int)!empty($gaConf['optoutCode']); for the Template --- Classes/Page/Part/FooterPart.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classes/Page/Part/FooterPart.php b/Classes/Page/Part/FooterPart.php index ccff2d9..c53ec4e 100644 --- a/Classes/Page/Part/FooterPart.php +++ b/Classes/Page/Part/FooterPart.php @@ -158,8 +158,10 @@ public function buildGoogleAnalyticsCode(array $tsServices, array $gaConf) $this->cObj->data['gaCode'] = $gaCode; $this->cObj->data['gaIsAnonymize'] = (int)!empty($gaConf['anonymizeIp']); $this->cObj->data['gaDomainName'] = $gaConf['domainName']; + $this->cObj->data['gaOptOutCode'] = (int)!empty($gaConf['optoutCode']); $this->cObj->data['gaCustomizationCode'] = $customCode; $this->cObj->data['gaUseUniversalAnalytics'] = (int)!empty($gaConf['universalAnalytics']); + // Build code $ret[] = $this->cObj->cObjGetSingle($gaConf['template'], $gaConf['template.']); From e6da7962352627ea406fd28fb21b637740c2ccaf Mon Sep 17 00:00:00 2001 From: Jonathan Starck Date: Fri, 1 Jun 2018 13:10:14 +0200 Subject: [PATCH 4/5] [FEATURE] Add Google Analytics Opt-Out for GDPR Add the Opt-Out-Code to the Template --- .../PageParts/ServiceGoogleAnalytics.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Resources/Private/Templates/PageParts/ServiceGoogleAnalytics.html b/Resources/Private/Templates/PageParts/ServiceGoogleAnalytics.html index de2c7c4..0787ccb 100644 --- a/Resources/Private/Templates/PageParts/ServiceGoogleAnalytics.html +++ b/Resources/Private/Templates/PageParts/ServiceGoogleAnalytics.html @@ -1,5 +1,17 @@ + + + +