(function () { // Send a request to the remote server to track the page view fetch( `${ cmParams.remoteUrl ?? "https://stats.codemade.net" }/track/${cmParams.tenant}`, { method: "POST", mode: "no-cors", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ url: window.location.href, referrer: document.referrer, userAgent: navigator.userAgent, screen: { width: window.screen.width, height: window.screen.height, }, viewport: { width: window.innerWidth, height: window.innerHeight, }, language: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, os: navigator.platform, }), }, ); })();