Posted By

scottnix on 09/20/11


Tagged

google wordpress Analytics thematic


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Kurt
logik42


Optimized Google Analytics for WordPress


 / Published in: PHP
 

Optimized Google Analytics (http://mathiasbynens.be/notes/async-analytics-snippet)

  1. // looad google analytics
  2. // optimized version http://mathiasbynens.be/notes/async-analytics-snippet
  3. function snix_google_analytics(){ ?>
  4. <script>var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'))</script>
  5. <?php }
  6. add_action('wp_footer', 'snix_google_analytics');

Report this snippet  

You need to login to post a comment.