Close #758 - Update to Google Universal Analytics

This commit is contained in:
Ben Word
2013-06-03 17:44:16 -05:00
parent 72a9ffa305
commit 66ac187564
2 changed files with 8 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
### HEAD ### HEAD
* Update to Google Universal Analytics
* Remove post tags from templates * Remove post tags from templates
* Remove TinyMCE valid elements tweaks (no longer necessary) * Remove TinyMCE valid elements tweaks (no longer necessary)
* Remove additional widget classes * Remove additional widget classes

View File

@@ -65,11 +65,14 @@ function roots_jquery_local_fallback($src, $handle) {
function roots_google_analytics() { ?> function roots_google_analytics() { ?>
<script> <script>
var _gaq=[['_setAccount','<?php echo GOOGLE_ANALYTICS_ID; ?>'],['_trackPageview']]; (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; e=o.createElement(i);r=o.getElementsByTagName(i)[0];
s.parentNode.insertBefore(g,s)}(document,'script')); e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','<?php echo GOOGLE_ANALYTICS_ID; ?>');ga('send','pageview');
</script> </script>
<?php } <?php }
if (GOOGLE_ANALYTICS_ID) { if (GOOGLE_ANALYTICS_ID) {
add_action('wp_footer', 'roots_google_analytics', 20); add_action('wp_footer', 'roots_google_analytics', 20);