Difference between revisions of "Template:Gatracker"

From Documentation
 
Line 1: Line 1:
 
$(function () {
 
$(function () {
 
+
  function handleWikiClicks(event) {
  function handleOutboundLinkClicks(event) {
 
 
   ga('send', 'event', {
 
   ga('send', 'event', {
 
     eventCategory: 'Outbound Link',
 
     eventCategory: 'Outbound Link',
Line 8: Line 7:
 
   });
 
   });
 
  }
 
  }
$('.galink').each(function(each){each.find('a').click(function(event){handleOutboundLinkClicks(event)});
+
$('.galink').each(function(each){each.find('a').click(function(event){handleWikiClicks(event)});
 
}());
 
}());

Latest revision as of 07:11, 31 May 2018

$(function () {

function handleWikiClicks(event) {
  ga('send', 'event', {
    eventCategory: 'Outbound Link',
    eventAction: 'click',
    eventLabel: event.target.href
  });
}
$('.galink').each(function(each){each.find('a').click(function(event){handleWikiClicks(event)});

}());