Thanks for the codes, it saves my day.
Btw for those who confuse how to create the button, i found another workaround by adding delay. So it will load the chat widget after “X” milliseconds.
Here’s the sample code with 15 seconds delay:
<script>
window.hsConversationsSettings = { loadImmediately: false };
setTimeout(function() {
window.HubSpotConversations.widget.load();
}, 15000);
</script>