MediaWiki:GoogleAnalytics.js

The Linux SCSI Target Wiki

Revision as of 10:13, 12 July 2010 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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-17412131-1");
    pageTracker._trackPageview();
  } catch(err) {}
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense