Added Google Analytics as a site level configuration variable

This commit is contained in:
Josh Sherman 2012-10-13 11:07:58 -04:00
parent 521deddc44
commit 7660ddc768
2 changed files with 14 additions and 2 deletions

View file

@ -45,8 +45,8 @@ $config = array(
),
'site' => array(
'name' => 'PICKLES Bootstrap',
'name' => 'PICKLES Bootstrap',
'analytics' => 'UA-########-#',
),
);

View file

@ -65,5 +65,17 @@
<script src="<?php echo $__dynamic->js('/js/bootstrap.js'); ?>"></script>
<script src="<?php echo $__dynamic->js('/js/pickles.js'); ?>"></script>
<script src="<?php echo $__dynamic->js('/js/core.js'); ?>"></script>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?php echo $__config->site['analytics']; ?>']);
_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>
</body>
</html>