MediaWiki:GoogleAnalytics.js

From Skypher

Jump to: navigation, search

Note - After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh); Konqueror: click Reload or press F5; Opera: clear the cache in Tools → Preferences; Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

// Code to insert Google Analytics:

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write("\x3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'\x3E\x3C/script\x3E");

addOnloadHook(trackPageView)

function trackPageView() {
  try {
    var pageTracker = _gat._getTracker("UA-549122-4");
    pageTracker._trackPageview();
  } catch(err) {}
}
Personal tools