Skip to content

Commit

Permalink
Add basic google analytics settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Kott committed Sep 29, 2014
1 parent ddd18ee commit aa7d6de
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Configuration/TypoScript/constants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# customsubcategory=150=Config
# customsubcategory=160=Theme
# customsubcategory=170=News
# customsubcategory=180=Tracking

############
### PAGE ###
Expand All @@ -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 {
Expand Down Expand Up @@ -93,6 +94,12 @@ page {
specialPages {
loginPid = 28
}
tracking {
google {
# cat=bootstrap package: basic/180/100; type=string; label=Google Tracking-ID
trackingID =
}
}
}


Expand Down
17 changes: 17 additions & 0 deletions Configuration/TypoScript/setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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');
)
}
}
}


Expand Down

0 comments on commit aa7d6de

Please sign in to comment.