1window.GlobalSkuFunnel = window.GlobalSkuFunnel || (function () { 2 var queued = false; 3 4 function csrfToken() { 5 var meta = document.querySelector('meta[name="csrf-token"]'); 6 return meta ? meta.getAttribute('content') : ''; 7 } 8 9 function track(eventName, payload) { 10 payload = payload || {}; 11 var body = JSON.stringify({ 12 event: eventName, 13 landing_path: payload.landing_path || (window.location && window.location.pathname) || '/', 14 platform: payload.platform || 'web', 15 properties: payload.properties || {}, 16 }); 17 18 try { 19 fetch('/marketing/funnel-event', { 20 method: 'POST', 21 headers: { 22 'Content-Type': 'application/json', 23 'Accept': 'application/json', 24 'X-CSRF-TOKEN': csrfToken(), 25 'X-Requested-With': 'XMLHttpRequest', 26 }, 27 body: body, 28 credentials: 'same-origin', 29 keepalive: true, 30 }).catch(function () {}); 31 } catch (e) {} 32 } 33 34 function landingView() { 35 if (queued) return; 36 queued = true; 37 track('landing_view'); 38 } 39 40 return { 41 track: track, 42 landingView: landingView, 43 quizStart: function (properties) { track('quiz_start', { properties: properties || {} }); }, 44 quizComplete: function (properties) { track('quiz_complete', { properties: properties || {} }); }, 45 emailCaptured: function (properties) { track('email_captured', { properties: properties || {} }); }, 46 checkoutStarted: function (properties) { track('checkout_started', { properties: properties || {} }); }, 47 }; 48})(); 49 50document.addEventListener('DOMContentLoaded', function () { 51 if (window.GSKU_TRACK_LANDING) { 52 window.GlobalSkuFunnel.landingView(); 53 } 54});
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.