Get a Free Audit of Your Magento Website
(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-T8LFZ6H');
if (localStorage.getItem("cookiesAccepted") !== "true") {
cookieWrap.innerHTML = cookieContent;
document.getElementById("cookie-popup").style.display = "block";
}
}, 5000);
});
function openHubSpot() {
const $liveChat = document.getElementById("chat");
$liveChat.addEventListener("click", function (event) {
event.preventDefault();
$liveChat.style.display = "none";
$liveChat.classList.add("loading");
const observer = new MutationObserver(function (mutationList, observer) {
mutationList.forEach(function (m) {
m.addedNodes.forEach(function (n) {
if (n.id === "hubspot-messages-iframe-container") {
n.querySelector('iframe').addEventListener('load', function () {
$liveChat.classList.remove("loading");
window.HubSpotConversations.widget.open();
observer.disconnect();
});
}
});
});
});
observer.observe(document.body, { childList: true, attributes: false, subtree: false });
window.HubSpotConversations.widget.load({ widgetOpen: true });
});
}
-->