Display the chat widget after some time spent on the websiteUpdated 4 months ago
To only display the chat after a certain amount of time, use the following method:
1<script>2var initGorgiasChatPromise = (window.GorgiasChat) ? window.GorgiasChat.init() : new Promise(function (resolve) { window.addEventListener('gorgias-widget-loaded', function () { resolve();})});34initGorgiasChatPromise.then(async function() {5 var chatElem = document.getElementById("gorgias-chat-container")6 chatElem.style.display = "none";78 function sleep(seconds) {9 return new Promise(resolve => setTimeout(resolve, seconds * 1000));10 }1112 await sleep(5) // CHANGE THIS VALUE TO THE NUMBER OF SECONDS TO WAIT BEFORE SHOWING THE CHAT BUBBLE13 chatElem.style.display = "";14})15</script>