From aa7d6de8a0151137bce3cd8d7977d8ef7f1e86c1 Mon Sep 17 00:00:00 2001 From: Benjamin Kott Date: Mon, 29 Sep 2014 17:32:07 +0200 Subject: [PATCH] Add basic google analytics settings --- Configuration/TypoScript/constants.txt | 9 ++++++++- Configuration/TypoScript/setup.txt | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Configuration/TypoScript/constants.txt b/Configuration/TypoScript/constants.txt index 2c4527deb..0f434e56e 100644 --- a/Configuration/TypoScript/constants.txt +++ b/Configuration/TypoScript/constants.txt @@ -9,6 +9,7 @@ # customsubcategory=150=Config # customsubcategory=160=Theme # customsubcategory=170=News +# customsubcategory=180=Tracking ############ ### PAGE ### @@ -26,7 +27,7 @@ page { # cat=bootstrap package: basic/160/100; type=options[Default=default, Inverse=inverse]; label=Navigation Style navigationstyle = default # cat=bootstrap package: basic/160/101; type=options[Default=, Fixed Top=top, Fixed Bottom=bottom]; label=Navigation Type - navigationtype = + navigationtype = # cat=bootstrap package: basic/160/110; type=boolean; label=Breadcrumb: Enable to display the breadcrumb breadcrumb = 1 copyright { @@ -93,6 +94,12 @@ page { specialPages { loginPid = 28 } + tracking { + google { + # cat=bootstrap package: basic/180/100; type=string; label=Google Tracking-ID + trackingID = + } + } } diff --git a/Configuration/TypoScript/setup.txt b/Configuration/TypoScript/setup.txt index fe2df2d78..eadbe874c 100644 --- a/Configuration/TypoScript/setup.txt +++ b/Configuration/TypoScript/setup.txt @@ -395,6 +395,23 @@ page { responsiveimages = {$page.includePath.javascript}Libs/jquery.responsiveimages.min.js main = {$page.includePath.javascript}main.min.js } + jsFooterInline { + # Google Analytics + 10 = TEXT + 10 { + if { + isTrue = {$page.tracking.google.trackingID} + } + value ( + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + ga('create', '{$page.tracking.google.trackingID}', 'auto'); + ga('send', 'pageview'); + ) + } + } }