Skip to content

Instantly share code, notes, and snippets.

@lcrespilho
Last active August 10, 2017 15:15
Show Gist options
  • Save lcrespilho/1635b81f440f5f839a84c95e00560f82 to your computer and use it in GitHub Desktop.
Save lcrespilho/1635b81f440f5f839a84c95e00560f82 to your computer and use it in GitHub Desktop.
<script>
var racc_hitsent = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*racc_hitsent\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1");
if (!racc_hitsent) {
var urlPixel = 'https://www.facebook.com/tr/?id=235391240155676&ev=Lead&dl=' + encodeURIComponent(document.location.href) + '&rl=' + encodeURIComponent(document.referrer) + '&if=false&ts=' + Date.now() + '&cd%5Bsite_name%5D=Wizard&cd%5Bcontent%5D=Cadastro%20Finalizado&v=2.7.19&ec=1&o=28';
var pixel = document.createElement('img');
pixel.width = '1';
pixel.height = '1';
pixel.style.display = 'none';
pixel.src = urlPixel;
document.body.appendChild(pixel);
// para capturar o cadastro final se este não for realizado na mesma sessão.
document.cookie = 'racc_hitsent=true; expires=' + new Date(Date.now() + 90 * 24 * 60 * 60 * 1000).toUTCString() + '; domain=wizardparcerias.com.br; path=/;';
}
</script>
@lcrespilho
Copy link
Author

Local de instalação da tag
Em qualquer lugar do <body> da página, mas de preferência no topo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment