window.__app.visit_id = 5115506 window.addEventListener("beforeunload", function() { var url = "" if (document.activeElement) { url = document.activeElement.href || "" if (!url && document.activeElement.parentElement) { url = document.activeElement.parentElement.href || "" } } var path = "/api/exits/5115506?url=" + encodeURIComponent(url) var xhr = new XMLHttpRequest xhr.open("GET", "//" + location.hostname + path) xhr.send() })