1(function () { 2 var TRACKING_ENDPOINT = 'https://ti.starturbanismo.com.br/botao-whatsapp/index.php'; 3 4 function getUTMParams() { 5 var params = new URLSearchParams(window.location.search); 6 return { 7 utm_source: params.get('utm_source'), 8 utm_medium: params.get('utm_medium'), 9 utm_campaign: params.get('utm_campaign'), 10 utm_content: params.get('utm_content'), 11 utm_term: params.get('utm_term'), 12 }; 13 } 14 15 function trackClick(e, btnElement) { 16 e.preventDefault(); 17 var targetUrl = btnElement.href; 18 19 if (btnElement.getAttribute('data-clicked') === 'true') return; 20 btnElement.setAttribute('data-clicked', 'true'); 21 22 var utms = getUTMParams(); 23 var payload = Object.assign({ 24 empreendimento: 'Start Urbanismo', 25 pagina: document.title || window.location.pathname, 26 botao: 'whatsapp-flutuante', 27 user_agent: navigator.userAgent, 28 page_url: window.location.href, 29 }, utms); 30 31 var opened = false; 32 function openLink() { 33 if (!opened) { 34 opened = true; 35 window.location.href = targetUrl; 36 } 37 } 38 39 try { 40 var blob = new Blob([JSON.stringify(payload)], { type: 'text/plain' }); 41 navigator.sendBeacon(TRACKING_ENDPOINT, blob); 42 setTimeout(openLink, 300); 43 } catch (err) { 44 fetch(TRACKING_ENDPOINT, { 45 method: 'POST', 46 mode: 'no-cors', 47 headers: { 'Content-Type': 'text/plain' }, 48 body: JSON.stringify(payload) 49 }).then(openLink).catch(openLink); 50 setTimeout(openLink, 1000); 51 } 52 } 53 54 document.addEventListener('click', function (e) { 55 var btn = e.target.closest('#whatsapp-float-btn'); 56 if (btn) trackClick(e, btn); 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.