/ Published in: JavaScript

Add the following code to skin.js file for automated event tracking to external sites or virtual page view to PDF's.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(function(){ $('a[href$=ashx]').bind('click', function (e) { e.preventDefault(); _gaq.push(['_trackPageview', $(this).attr('href')]); setTimeout("window.location = '" + $(this).attr('href') + "'", 100); }); $('a[href*="subdomain.domain.com"]').bind('click', function (e) { e.preventDefault(); _gaq.push(['_trackEvent', 'Click to Online Application', window.location.pathname, $(this).attr('href') ]); _gaq.push(['_link', $(this).attr('href')]); setTimeout("window.location = '" + $(this).attr('href') + "'", 100); return false; }); });
Comments
