Posted By

tiw on 10/10/08


Tagged

textmate mw


Versions (?)

google analytics


 / Published in: Other
 

  1. $wgExtensionFunctions[] = 'wfGoogleAnalytics';
  2. function wfGoogleAnalytics() {
  3. global $wgOut;
  4. $wgOut->addScript(
  5. '<script type="text/javascript">
  6. var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  7. document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  8. </script><script type="text/javascript">
  9. var pageTracker = _gat._getTracker("INSERT YOUR TRACKING CODE HERE");
  10. pageTracker._trackPageview();</script>'
  11. );
  12. }

Report this snippet  

You need to login to post a comment.