1var $trackOutboundLink_ga = function($url, $callback) 2{ 3 ga('send', 'event', 'outbound', 'click', $url, { 4 'transport': 'beacon', 5 'hitCallback': $callback 6 }); 7}; 8 9var $trackOutboundLink_gtag = function($url, $callback) 10{ 11 gtag('event', 'click', { 12 'event_category': 'outbound', 13 'event_label': $url, 14 'transport_type': 'beacon', 15 'event_callback': $callback 16 }); 17}; 18 19jQuery(document).ready(function($){ 20 21 if( gagTracker.link_tracking ) { 22 23 $('a:not([href^="' + gagTracker.url + '"], [href^="#"])').on('click', function (e) { 24 25 var $callback; 26 var $url = $(this).attr('href'); 27 28 if( typeof $url === 'undefined' || $url === '') { 29 return; 30 } 31 32 if( $(this).attr('target') !== '_blank' ) { 33 34 e.preventDefault(); 35 36 $callback = function() { 37 window.location.href = $url; 38 }; 39 40 } 41 42 if (gagTracker.mode == 'ua') { 43 $trackOutboundLink_ga($url, $callback); 44 } else { 45 $trackOutboundLink_gtag($url, $callback); 46 } 47 48 }); 49 50 } // gagTracker.link_tracking 51 52});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.