Using both Quriobot and HubSpot live chat

So, although we have a live chat option in Quriobot you can use the best of both worlds!

Meaning that you use Quriobot to start your HubSpot live chat widget if a user wants to talk to a live person and switch back once that conversation is over!

Pretty cool, right? So here is the demo of Quriobot using the HubSpot widget as a fallback for the live chat:

The live demo is located here.

Step 0: In this explanation I already assume you to have a Quriobot running on your website.

Step 1: Include the HubSpot installation code on your website:

Step 2: Add this code BEFORE the widget code:

<script type="text/javascript">
window.hsConversationsSettings = {
loadImmediately: false
};
</script>

Step 3:  We will make use of the Script Chat Text, HubSpot Conversations Javascript API:

function() {
    window.HubSpotConversations.on('conversationClosed', function() {
       window.HubSpotConversations.widget.remove();
       document.getElementById("botbutton").classList.add('show');
       quriobot.show_frame();
    });
    quriobot.hide_frame();
    setTimeout(function(){
        document.getElementById("botbutton").classList.remove('show');
       window.hsConversationsSettings = {
           identificationEmail: '{{email}}'
       }
        window.HubSpotConversations.widget.load({ widgetOpen: true });
    }, 3000)
}

Note: here we assume there a bot variable email that is connected to an email step. If that’s not applicable to your bot, you can remove that line completely.

Note: HubSpot Conversations Javascript API doesn’t seem to support setting an identity of the user ATM.

That’s it! If you add this as a response to an answer option, for example, you will start the HubSpot widget chat and hide Quriobot. Closing the conversation in HubSpot chat will make Quriobot reappear!

Enjoy!

Edit this page