window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l="+l:"';j.async=true;j.src="https://www.googletagmanager.com/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-TBZ76RQ');
var gotag = document.createElement('iframe'); gotag.src = "https://www.googletagmanager.com/ns.html?id=GTM-TBZ76RQ"; gotag.style.height = 0; gotag.style.width = 0; gotag.style.display = 'none';
document.body.appendChild(gotag); console.log('gtag appended')
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
console.log("script runs"); const subscribeForm = document.getElementById("mc-embedded-subscribe-form");
subscribeForm && subscribeForm.addEventListener("submit", (event) => { const errorTarget = document.getElementsByClassName('mce_inline_error'); const responseTarget = document.getElementsByClassName('response');
if (errorTarget.length > 0) {
console.log("errors test");
for (let i = 0; i < errorTarget.length; i++) {
if(!errorTarget[i].classList.contains('newsletter-element__input')) {
setTimeout(() => {
errorTarget[i].style.display = 'none';
}, 4000);
}
}
}
if (responseTarget) {
setTimeout(() => {
for (let i = 0; i < responseTarget.length; i++) {
responseTarget[i].style.display = 'none';
}
}, 4000);
}
}, false);
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
function mc_resp_0(a){a.style.display='none';a.removeAttribute("class");a.innerHTML='';}
document.querySelectorAll("form#MC").forEach(function(form){form.addEventListener("submit",function(e){e.preventDefault();if(document.querySelector('#MC_robot').value !==''){return false}var script = document.createElement('script');let email=form.querySelector('input#MC_email');script.src=this.action.replace('/post?','/post-json?')+'&EMAIL='+email.value;document.body.appendChild(script);var callback = 'callback';window[callback] = function(data) {delete window[callback];document.body.removeChild(script);
var parts = data.msg.split(' - ', 2);if (parts[1] === undefined) {msg = data.msg;} else {var i = parseInt(parts[0], 10);if (i.toString() === parts[0]) {index = parts[0];msg = parts[1];} else {index = -1;msg = data.msg;}}let resp=form.querySelector('#MC_resp');mc_resp_0(resp);resp.innerHTML=msg;if(data.result=='error'){resp.classList.add('bad');}else{resp.classList.add('good');email.value="";}
resp.style.display='inline-block';setTimeout(function(){mc_resp_0(resp)},3000);
console.log(data);}
})});
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
(function(d,s){var DID="b0bf7582-16c5-4fc1-a03f-8f705ea43617";var js,fjs=d.getElementsByTagName(s)[0];js=d.createElement(s);js.async=1;js.src="https://track.cbdatatracker.com/Home?v=3&id='"+DID+"'";fjs.parentNode.insertBefore(js,fjs);}(document,'script'))
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
!function(e,t,r,n){if(!e[n]){for(var a=e[n]=[],i=["survey","reset","config","init","set","get","event","identify","track","page","screen","group","alias"],s=0;s
} else if(offsetElement.getBoundingClientRect().top < topValueToCheck && stickySahreContainer.getBoundingClientRect().bottom < bottomValuetoCheck) { stickyShareElement.style.position="absolute"; stickyShareElement.style.top= "auto"; stickyShareElement.style.bottom= "0"; stickyShareElement.style.left= ""; } else { stickyShareElement.removeAttribute("style") } }, 100); if(window.innerWidth > 768){ window.addEventListener("scroll", setSharePosition); window.addEventListener("resize" ,function(){ leftShareOffsetValue =window.innerWidth > 900 ? (( offsetElement.getBoundingClientRect().left-80 )): 20; }) } }
});
Read the full article here