You are on page 1of 2

—————— Scripts Segredos Ecom ——————

INSTRUÇÕES:

PASSOS:
ONLINE STORE -> PREFERENCES -> COLOCAR NO ​Additional Google 
Analytics JavaScript…  
 
OBS.:​ ANTES VOCÊ PRECISA COLOCAR SEU CÓDIGO DO GOOGLE 
ANALYTICS…  
 
Exemplo: UA-1234-5 
 
—————— Código abaixo —————————— 
 
function createCookie(a,b,c){if(c){var d=new 
Date;d.setTime(d.getTime()+c*60*1e3);var e="; 
expires="+d.toUTCString()}else var 
e="";document.cookie=a+"="+b+e+"; path=/"}function 
readCookie(a){for(var 
b=a+"=",c=document.cookie.split(";"),d=0;d<c.length;d++){for(var 
e=c[d];" 
"==e.charAt(0);)e=e.substring(1,e.length);if(0==e.indexOf(b))return 
e.substring(b.length,e.length)}return null}function 
eraseCookie(a){createCookie(a,"",-1)}function crtmedir(a){var 
b=document.createDocumentFragment(),c=document.createElement("d
iv");for(c.innerHTML=a;c.firstChild;)b.appendChild(c.firstChild);return 
b}function startTimer(start, duration, display){var 
diff,minutes,seconds;function 
timer(){diff=duration-(((Date.now()-start)/1000)|0);minutes=(diff / 
60)|0;seconds = (diff % 60)|0;minutes = minutes < 10 ? "0" + minutes : 
minutes;seconds = seconds < 10 ? "0" + seconds : 
seconds;display.textContent = minutes + ":" + seconds; if (diff <= 
0){clearInterval(inti);document.getElementById("countdownhere").innerH
TML = "Sua reserva foi cancelada!";start = Date.now() + 
1000;}};timer();var inti = setInterval(timer, 1000);}var pdm = 
crtmedir('<div class="countdownholder"><div id="countdownhere" 
style="display:block;background:#fff5d2;padding:10px 20px;border:1px 
solid 
#e3df74;font-size:14px;color:#2c2c2c;font-weight:bold;-webkit-border-r
adius: 5px;-moz-border-radius: 5px;border-radius: 5px; margin:20px 
0px">Frete Grátis nos próximos <span id="time"></span> 
minutos!</div><div style="display:table;width:100%"><div 
style="width:50%;display:table-cell;float:none;height:100%;vertical-alig
n:middle;text-align:center"><img 
src="https://cdn.shopify.com/s/files/1/0073/1870/0068/files/checkoutga
rantia2.png?385" style="margin:0 auto"></div><div 
style="width:50%;display:table-cell;float:none;height:100%;vertical-alig
n:middle;text-align:center"><img 
src="https://cdn.shopify.com/s/files/1/0073/1870/0068/files/checkoutga
rantia.png?385" style="margin:0 auto"></div><div 
</div>');if(window.location.href.indexOf('checkout') > -1 && 
document.location.href.indexOf('thank_you') === -1 && 
document.location.href.indexOf('orders') === -1){window.onload = 
function () { 
document.getElementsByClassName('main__header')[0].appendChild(p
dm);var dolzina=15;var ten=60*dolzina;var starttime=Date.now();var 
xcnt=readCookie('prtcntdwn');if(xcnt){if(starttime<xcnt){ten=(xcnt-startti
me)/1000;}else{eraseCookie('ptcntdwn');createCookie('prtcntdwn',Date.
now()+(ten*1000),ten+1);}}else{createCookie('prtcntdwn',Date.now()+(te
n*1000),ten+1);}display=document.querySelector('#time');startTimer(star
ttime, ten, display);};} 

You might also like