(function () { try { if (localStorage.getItem('web4ai.stats.disabled') === '1') return; } catch (e) {} function send() { var p = location.pathname; if (p.indexOf('/s/') !== 0) return; var h = location.hash || ''; var tab = h.indexOf('#/') === 0 && h !== '#/' ? h : ''; var utm = new URLSearchParams(location.search).get('utm_source') || ''; var body = JSON.stringify({path: p + tab, referrer: document.referrer, utm_source: utm}); var blob = new Blob([body], {type: 'text/plain;charset=UTF-8'}); if (navigator.sendBeacon && navigator.sendBeacon('/v1/track/view', blob)) return; fetch('/v1/track/view', {method: 'POST', body: body, keepalive: true, headers: {'Content-Type': 'text/plain'}}).catch(function () {}); } send(); window.addEventListener('hashchange', send); })();