// $Id:$ // Setup everything for Google Analytics function ga_init() { filetypes = "xls|pdf|doc"; $("a").each(function(i) { // Track all external links if (!$(this).attr("href").match(Drupal.settings.basepath.replace(/\//g, "\/"))) { path = $(this).attr("href").replace(/http\:\/\/(www\.)*/g, "").replace(/[/.:]/g, "_") $(this).click(function() {urchinTracker("/outgoing/" + path);}) } // Track all downloads (links with a given extension) if ($(this).attr("href").match(filetypes)) { path = $(this).attr("href").replace(/http\:\/\/(www\.)*/g, "").replace(/[/.:]/g, "_") $(this).click(function() {urchinTracker("/downloads/" + path);}) } }); // Get the User ID _uacct = Drupal.settings.uacct; urchinTracker(); } // Start the script once all page is loaded $(function() {ga_init();})