1 2jQuery(document).ready(function($) { 3 dropfilesTrackDownload(); 4}); 5 6function dropfilesSendTrackingEventThenDownload(Action, Label, Url) { 7 "use strict"; 8 var rtn = false; 9 if (typeof (_gaq) !== "undefined") { 10 _gaq.push(['_trackEvent', 'Dropfiles', Action, Label]); 11 rtn = true; 12 } 13 14 if (typeof (ga) !== "undefined") { 15 try { 16 var trackers = window.ga.getAll(); 17 // Send event to all trackers 18 trackers.forEach(function(tracker) { 19 var trackerName = tracker.get('name'); 20 if (trackerName) { 21 ga(trackerName + '.send', 'event', 'Dropfiles', Action, Label); 22 } 23 }); 24 } catch (error) { 25 console.log(error); 26 } 27 rtn = true; 28 } 29 30 if (typeof (gtag) !== "undefined") { 31 gtag('event', Action, { 32 'event_category' : 'Dropfiles', 33 'event_label' : Label 34 }); 35 rtn = true; 36 } 37 38 return rtn; 39} 40 41function dropfilesTrackDownload() { 42 if(ga_download_tracking === "1") { 43 jQuery(document).on('click', 'a.downloadlink', function(e) { 44 var href = jQuery(this).attr('href'); 45 var extLink = href.replace(/^https?\:\/\//i, ''); 46 47 dropfilesSendTrackingEventThenDownload('Download', extLink, href); 48 }) 49 50 //run below code when open preview on new tab 51 .on('click', 'a.openlink', function(e) { 52 var href = jQuery(this).attr('href'); 53 var extLink = href.replace(/^https?\:\/\//i, ''); 54 55 dropfilesSendTrackingEventThenDownload('Preview', extLink, href); 56 }); 57 } 58}
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.