Created
February 5, 2025 18:46
-
-
Save Withoutbytes/58812f6bc8c1cbdd98f699b20b822412 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| try { | |
| const merchantId = "manhattan_br"; // Substitua pelo seu Merchant ID | |
| const fingerPrint = new Date().getTime(); | |
| const sessionId = `${merchantId}${fingerPrint}`; // Gera um sessionId único | |
| // Insere o script de fingerprinting dinâmico | |
| const script = document.createElement("script"); | |
| script.type = "text/javascript"; | |
| script.src = `https://h.online-metrix.net/fp/tags.js?org_id=k8vif92e&session_id=${sessionId}`; | |
| script.async = true; | |
| document.head.appendChild(script); | |
| // Adiciona fallback para clientes sem JavaScript | |
| const noscript = document.createElement("noscript"); | |
| noscript.innerHTML = ` | |
| <iframe | |
| style="width: 100px; height: 100px; border: 0; position: absolute; top: -5000px;" | |
| src="https://h.online-metrix.net/fp/tags?org_id=k8vif92e&session_id=${sessionId}"> | |
| </iframe>`; | |
| document.body.appendChild(noscript); | |
| // Expõe o sessionId corretamente via API global | |
| window.getFingerprintSession = function () { | |
| return { | |
| sessionId: fingerPrint, // Corrigido para `sessionId` | |
| timestamp: new Date().toISOString(), | |
| }; | |
| }; | |
| console.log("Fingerprint session initialized:", fingerPrint); | |
| } catch (error) { | |
| console.error("Erro ao inicializar o Fingerprint:", error); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment