1var thirstyGct; 2 3jQuery( document ).ready( function ($) { 4 5 thirstyGct = { 6 7 trackClick: function () { 8 if ( ! window.thirstyFunctions) { 9 return; 10 } 11 12 if ( tap_gct_vars.ga_func_name === '_gaq.push' ) { 13 if ( typeof _gaq == 'undefined' || typeof _gaq.push != 'function' ) { 14 return; 15 } 16 } else if ( tap_gct_vars.ga_func_name === 'dataLayer.push' ) { 17 if ( typeof dataLayer == 'undefined' || typeof dataLayer.push != 'function' ) { 18 return; 19 } 20 } else if (typeof window[tap_gct_vars.ga_func_name] != 'function') { 21 return; 22 } 23 24 var $this = $( this ), 25 linkID = $this.data( 'linkid' ), 26 href = linkID ? $this.attr( 'href' ) : thirstyFunctions.isThirstyLink( $this.attr( 'href' ) ); 27 28 if ( ! href ) { 29 return; 30 } 31 32 var is_uncloak = href.indexOf( tap_gct_vars.home_url + '/' + thirsty_global_vars.link_prefix ) < 0, 33 href_parts = href.split('/'), 34 href_last = href_parts[ href_parts.length - 1 ] ? href_parts[ href_parts.length - 1 ] : href_parts[ href_parts.length - 2 ], 35 link_text = $this.text(), 36 link_uri = linkID && is_uncloak ? href : href.replace( tap_gct_vars.home_url , '' ), 37 link_slug = linkID && is_uncloak ? href : href_last, 38 event_action; 39 40 if ( tap_gct_vars.event_action === 'href' ) { 41 event_action = href; 42 } else if ( tap_gct_vars.event_action === 'link_text' ) { 43 event_action = link_text; 44 } else if ( tap_gct_vars.event_action === 'link_slug' ) { 45 event_action = link_slug; 46 } else { 47 event_action = link_uri; 48 } 49 50 switch (tap_gct_vars.script_type) { 51 case 'gtm': 52 dataLayer.push({ event: tap_gct_vars.action_name, link_uri: event_action }); 53 break; 54 case 'legacy_ga': 55 _gaq.push( [ '_trackEvent', tap_gct_vars.action_name, event_action, tap_gct_vars.page_slug, undefined, false ] ); 56 break; 57 case 'universal_ga': 58 window[tap_gct_vars.ga_func_name]( 'send', 'event', { 59 eventCategory: tap_gct_vars.action_name, 60 eventAction: event_action, 61 eventLabel: tap_gct_vars.page_slug, 62 transport: 'beacon' 63 } ); 64 break; 65 case 'gtag_ga': 66 default: 67 gtag( 'event', tap_gct_vars.action_name, { 68 event_category: tap_gct_vars.action_name, 69 event_action: event_action, 70 event_label: tap_gct_vars.page_slug 71 } ); 72 } 73 } 74 75 }; 76 77 $( 'body' ).on( 'click', 'a', thirstyGct.trackClick ); 78 79 // Backwards compatibility 80 window.thirstyGoogleClickTrack = thirstyGct.trackClick; 81});
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.