Time based switch between Quriobot and Livechat

Quriobot is super cool, and you can use custom live chat mode via the external service and you want to support live chat on your website for your visitors. For the native live chat mode, Quriobot takes into account the number of agents online. With this solution, you can easily set up to have a custom Live chat during certain hours of the day and fully automated Quriobot for all other moments.

The only thing you need to do is add the following code to your website HTML (within theelement):

<!DOCTYPE HTML>
<html>
    <head></head>
  <body>
    <!-- Example script code for time based switch starts here -->
    <script type="text/javascript">
      const date = new Date();
      const day = date.getDay();
      const hour = date.getHours();
      const minute = date.getMinutes();

      if (day >= 1 && day <= 5 && hour >= 8 && hour <= 15) {

        <!--
          your live chat solution widget code goes here
        -->

      } else if (day >= 1 && day <= 5 && hour == 16 && minute <= 30) {

        <!--
          your live chat solution widget code goes here
        -->

      } else {

        <!--
          your Quriobot snippet (copy-paste that from the embed code -> snippet)         -->
      }
    </script>
    <!-- Example script code for time based switch ends here -->
  </body>
</html>

In the example, the snippet above the live chat will load on Monday to Friday, 09:00 - 17:30

Note: some live chat agents even support switching between Quriobot and live chat. For example, LiveAgent

Credits go to Jamie Barrett for first coming up with and sharing this solution!

Edit this page

Tags
See also