1jQuery(function ($) { 2 3 'use strict'; 4 5 $(document).ajaxComplete(function () { 6 // New content has been added to the page. 7 if ($('#customDonationTrackingAvbl').length == 1) { 8 var cdamt = 0; 9 var cdid = 0; 10 var cdtype = ''; 11 12 if ($('#customDonationTrackingAmt').length == 1) { 13 cdamt = parseFloat($('#customDonationTrackingAmt').val()); 14 } 15 16 if ($('#customDonationTrackingType').length == 1) { 17 cdtype = $('#customDonationTrackingType').val(); 18 } 19 20 if ($('#customDonationTrackingId').length == 1) { 21 cdid = parseInt($('#customDonationTrackingId').val()); 22 } 23 24 // send custom event 25 if (typeof fbq !== "undefined") { 26 fbq('track', 'Purchase', {value: cdamt, currency: 'USD'}); 27 } 28 else { 29 // if (window.console) { console.log('{currency: "USD", value: ' + cdamt + '}'); } 30 } 31 32 if (typeof ga !== "undefined") { 33 ga('send', 'pageview', '/donation-confirmation?type=' + cdtype + '&donation_id=' + cdid + '&amount=' + cdamt); 34 } 35 else if (typeof __gaTracker !== "undefined") { 36 __gaTracker('send', 'pageview', '/donation-confirmation?type=' + cdtype + '&donation_id=' + cdid + '&amount=' + cdamt); 37 } 38 else { 39 // if (window.console) { console.log('donation-confirmation?type=' + cdtype + '&donation_id=' + cdid + '&amount=' + cdamt); } 40 } 41 42 // remove to prevent duplicate tracking 43 $('#customDonationTrackingAvbl, #customDonationTrackingAmt, #customDonationTrackingType, #customDonationTrackingId').remove(); 44 } 45 }); 46 47});
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.