1jQuery && (function($) { 2 3 4 5 /** 6 * Check which Analytics function use 7 */ 8 function sponsorClickEvent(sponsorId) { 9 10 if ('function' == typeof gtag) { 11 sponsorClickEventGTag(sponsorId); 12 } 13 14 if ('function' == typeof ga) { 15 sponsorClickEventGA(sponsorId); 16 } 17 } 18 19 20 21 /** 22 * https://developers.google.com/analytics/devguides/collection/gtagjs/events 23 * https://developers.google.com/analytics/devguides/collection/gtagjs/sending-data 24 */ 25 function sponsorClickEventGTag(sponsorId) { 26 gtag( 27 'event', 28 'SponsorClick', 29 { 30 'gtr_item_id' : sponsorId, 31 'gtr_page_path' : window.location.pathname 32 } 33 ); 34 } 35 36 37 38 /** 39 * https://developers.google.com/analytics/devguides/collection/analyticsjs/events 40 * ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]); 41 */ 42 function sponsorClickEventGA(sponsorId) { 43 ga( 44 'send', 45 'event', 46 'SponsorClick', // Event Category 47 window.location.pathname, // Event Action 48 sponsorId // Event Label 49 ); 50 } 51 52 53 54 /** 55 * Start after page load 56 */ 57 $(window).on('load', function() { 58 59 $('.logos-partners a').click(function() { 60 var sponsorId = parseInt($(this).attr('data-sponsor-id'), 10); 61 sponsorId > 0 && sponsorClickEvent(sponsorId); 62 return true; 63 }); 64 65 }); 66 67 68 69})(jQuery);
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.