google analytics


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.