From 17859dc95d979fbed9a5067d47f9c7d9037aeaf4 Mon Sep 17 00:00:00 2001 From: Mats Svensson Date: Tue, 31 Oct 2017 09:42:36 +0100 Subject: [PATCH] [FEATURE] Google Tag Manager (#312) * [FEATURE] Google Tag Manager * [TASK] remove condition with regexp and use .if to improve performance --- .../TypoScript/Library/page.gtm.setupts | 24 +++++++++++++++++++ .../themes.googlewebmastertools.constantsts | 8 +++++++ 2 files changed, 32 insertions(+) create mode 100644 Configuration/TypoScript/Library/page.gtm.setupts diff --git a/Configuration/TypoScript/Library/page.gtm.setupts b/Configuration/TypoScript/Library/page.gtm.setupts new file mode 100644 index 00000000..747c1ec6 --- /dev/null +++ b/Configuration/TypoScript/Library/page.gtm.setupts @@ -0,0 +1,24 @@ +# Google Analytics track pageview and add script for event tracking +page.headerData.17895 = TEXT +page.headerData.17895 { + if.isTrue = {$themes.configuration.tracking.ga_gtmid} + value ( + + + + +) +} + +page.3 = TEXT +page.3 { + if.isTrue = {$themes.configuration.tracking.ga_gtmid} + value ( + + + + +) +} diff --git a/Configuration/TypoScript/Library/themes.googlewebmastertools.constantsts b/Configuration/TypoScript/Library/themes.googlewebmastertools.constantsts index fd1e2f67..d3379f43 100644 --- a/Configuration/TypoScript/Library/themes.googlewebmastertools.constantsts +++ b/Configuration/TypoScript/Library/themes.googlewebmastertools.constantsts @@ -12,3 +12,11 @@ themes.configuration.tracking.ga_account = # customsubcategory=googleWebMasterTools= Google Webmaster Tools # cat=theme,expert/googleWebMasterTools/; type=string; label= Google Search Console themes.configuration.tracking.ga_siteVerification = + + +############################################# +# Google Tag Manager +############################################# +# customsubcategory=googleWebMasterTools= Google Webmaster Tools +# cat=theme,expert/googleWebMasterTools/; type=string; label= Google Tag Manager Id +themes.configuration.tracking.ga_gtmid =