Skip to content

Commit

Permalink
New GA code
Browse files Browse the repository at this point in the history
  • Loading branch information
Uncle Cheese committed Nov 16, 2015
1 parent 707414d commit 3d4b543
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions conf/apigen/templates/@layout.latte
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,26 @@ the file LICENSE.md that was distributed with this source code.
{var ionicons = 'resources/ionicons.min.css'}
<link rel="stylesheet" type="text/css" href="{$ionicons|staticFile}" />

<script n:if="$config->googleAnalytics" type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', {$config->googleAnalytics}]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
<script>
(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', 'UA-84547-17', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', [
'silverstripe.com',
'silverstripe.org',
'addons.silverstripe.org',
'api.silverstripe.org',
'doc.silverstripe.org',
'userhelp.silverstripe.org',
'demo.silverstripe.org'
]);
ga('send', 'pageview');
</script>

<script>window.GLOBAL_NAV_SECONDARY_ID = 1559;</script>
</head>

Expand Down

0 comments on commit 3d4b543

Please sign in to comment.