Difference between revisions of "Template:Gatracker"

From Documentation
(Created page with "$(function () { function handleOutboundLinkClicks(event) { ga('send', 'event', { eventCategory: 'Outbound Link', eventAction: 'click', eventLabel: event.targe...")
 
Line 8: Line 8:
 
   });
 
   });
 
  }
 
  }
 
+
$('.galink').each(function(each){each.find('a').click(function(event){handleOutboundLinkClicks(event)});
 
}());
 
}());

Revision as of 07:06, 31 May 2018

$(function () {

function handleOutboundLinkClicks(event) {
  ga('send', 'event', {
    eventCategory: 'Outbound Link',
    eventAction: 'click',
    eventLabel: event.target.href
  });
}

$('.galink').each(function(each){each.find('a').click(function(event){handleOutboundLinkClicks(event)}); }());