Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readCookie(name) {
- var nameEQ = name + "=";
- var ca = document.cookie.split(';');
- for (var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') c = c.substring(1, c.length);
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
- }
- return '';
- }
- function insere(linkVarejista, idElm) {
- setTimeout(function() {
- document.getElementById('ignite').insertAdjacentHTML('beforebegin', '<img id="' + idElm +'" src="' + linkVarejista + '" style="visibility: hidden; position: absolute;" />');
- ga('send', 'event', 'Load', idElm, '.', { 'nonInteraction': 1});
- }, 10000);
- setTimeout(function() {
- removeElement(document.getElementById(idElm));
- }, 15000);
- }
- var ckDone = readCookie("done");
- if (ckDone == '') {
- //Seta Cookie
- var date = new Date();
- date.setTime(date.getTime() + (3600 * 1000)); //1 hora
- var expires = "; expires=" + date.toGMTString();
- document.cookie = "done=" + document.location.href + expires + "; path=/";
- //Pares
- if (new Date().getMinutes() % 2 == 0) {
- insere('https://www.amazon.com.br/?tag=opiniaobomv0a-20', 'elm4');
- }
- insere('https://www.submarino.com.br/?opn=AFLNOVOSUB&franq=AFL-03-201088&epar=b2wafiliados&sellerId=00776574000660', 'elm5');
- insere('https://www.americanas.com.br/?opn=AFLACOM&franq=AFL-03-201088&epar=b2wafiliados&sellerId=00776574000660', 'elm6');
- insere('https://www.shoptime.com.br/?opn=AFLSHOP&franq=AFL-03-201088&epar=b2wafiliados&sellerId=00776574000660', 'elm7');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement