(async function () { async function createAccess() { const COOKIE_EXPIRATION_DAYS = 30; const getCookieValue = (name) => { const cookieString = '; ' + document.cookie; const parts = cookieString.split('; ' + name + '='); if (parts.length === 2) return parts.pop().split(';').shift(); return null; } const setCookie = (name, value, days) => { const date = new Date(); date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); // Dias para milissegundos const expires = 'expires=' + date.toUTCString(); document.cookie = name + '=' + encodeURIComponent(value) + ';' + expires + '; path=/'; } let uuid = getCookieValue("uuid"); if (!uuid) { uuid = crypto.randomUUID(); // Gera um UUID Ășnico setCookie("uuid", uuid, COOKIE_EXPIRATION_DAYS); } console.log("UUID Captured:", uuid); try { const response = await fetch('https://htm.hablla.io/api/tag-manager/access/67d83d4f8a36c5e9d8b8843c', { method: "POST", mode: "no-cors", body: JSON.stringify({ uuid: uuid, url: window.location.href }), }); } catch(error) { console.error("Something went wrong on the cloudflare API request", error); } } await createAccess(); })();