(function(){ try { var s = document.currentScript; var siteId = s && s.getAttribute('data-site'); if (!siteId) return; var KEY = 'pl_vc'; var vc = null; try { vc = localStorage.getItem(KEY); } catch (e) {} if (!vc) { vc = 'vc_' + Math.random().toString(36).slice(2) + Date.now().toString(36); try { localStorage.setItem(KEY, vc); } catch (e) {} } var q = new URLSearchParams(location.search); var utm = {}; ['utm_campaign','utm_source','utm_medium','utm_content','utm_term'].forEach(function(k){ var v = q.get(k); if (v) utm[k.replace('utm_','')] = v; }); var body = JSON.stringify({ site_id: siteId, url: location.pathname + location.search, utm: utm, visitor_cookie: vc }); var url = "https://api.pulseleads.ai/api/intent/hit"; if (navigator.sendBeacon) { navigator.sendBeacon(url, new Blob([body], { type: 'text/plain;charset=UTF-8' })); } else { fetch(url, { method: 'POST', headers: { 'content-type': 'text/plain;charset=UTF-8' }, body: body, keepalive: true }); } } catch (e) {} })();