(function() { if (!discover_site_id) { console.error("Site ID is not correct"); return; } loadfiveByfiveScript(); function sendApiRequest(event) { const apiUrl = 'https://api.throttleup.ai/tracker2'; const payload = { action: event, timestamp: new Date().toISOString(), name: getPageFromUrl(window.location.href), title: document.title, site_id: discover_site_id, }; fetch(apiUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }).then(async response => { const resp = await response.json(); }).catch(error => console.error('Error sending API request:', error)); } function getPageFromUrl(url) { const parsedUrl = new URL(url); let pathname = parsedUrl.pathname; if (pathname === "") { pathname = "/"; } return pathname; } function loadfiveByfiveScript() { var fiveByfive_script = document.createElement('script'); fiveByfive_script.type = 'text/javascript'; fiveByfive_script.async = true; const sitePID = "6648e52bc12e6ce43bc7a9cc83dacf1981caeaa823fd623c1d759bf326cb596d"; const title = document.title; const redirectUrl = encodeURIComponent('https://api.throttleup.ai/tracker2?hem=${HEM_SHA256_LOWERCASE}&up_id=${UP_ID}&action=page&site_id=' + discover_site_id + '&title=' + title); fiveByfive_script.src = `https://a.usbrowserspeed.com/cs?pid=${sitePID}&puid=${discover_site_id}&r=${redirectUrl}`; var existing_script = document.getElementsByTagName('script')[0]; existing_script.parentNode.insertBefore(fiveByfive_script, existing_script); } function handleUrlChange() { sendApiRequest('page'); } let lastUrl = location.href; new MutationObserver(() => { const url = location.href; if (url !== lastUrl) { lastUrl = url; handleUrlChange(); } }).observe(document, { subtree: true, childList: true }); })();