A script can be added to the website to control when the different chats appear. 


This is example coding for Podium or ST Chat to Text and Schedule Engine.

 

The days/times are configured for when the Schedule Engine chat will appear:


Day 0 is Sunday, etc. 

In this example Day 1 - Monday, SE Chat will appear before 07:00 and after 18:00.

In the bottom section that controls the Podium Chat, insert the Podium API key.  

The SE chat will appear for the times listed and all other times the Podium chat will appear.

<script>

    var hour_of_day = new Date().getHours();

    var day_of_week = new Date().getDay();

    if (day_of_week == 0 || 

        day_of_week == 1 && hour_of_day <= 7 || 

        day_of_week == 1 && hour_of_day >= 18 || 

        day_of_week == 2 && hour_of_day <= 7 || 

        day_of_week == 2 && hour_of_day >= 18 || 

        day_of_week == 3 && hour_of_day <= 7 || 

        day_of_week == 3 && hour_of_day >= 18 || 

        day_of_week == 4 && hour_of_day <= 7 || 

        day_of_week == 4 && hour_of_day >= 18 || 

        day_of_week == 5 && hour_of_day <= 7 || 

        day_of_week == 5 && hour_of_day >= 18 || 

        day_of_week == 6) {

            WebChat.loadChat({ apiKey: 'insertchatkey', primaryAccentColor: '#888888', autoOpen: true, autoOpenMobile: false, mobileHeightPercentage: 75, autoOpenExpiration: 1, title: 'Hi and welcome to Company Name, what can I help you with today?', initialMessage:  [] });

    }

    else {

      var script = document.createElement('script');

      script.src = "https://connect.podium.com/widget.js#API_TOKEN=podiumtoken";

      script.id = 'podium-widget';

      script.type = 'text/javascript';

      script.setAttribute('data-api-token', "podiumtoken");

      document.getElementsByTagName('body')[0].appendChild(script);        

    }

</script>


This is the example coding for Service Titan Chat to Text and Schedule EngineThe days/times are configured for when the SE chat will appearDay 0 is Sunday, etc.


In this example Day 1 - Monday, SE Chat will appear before 07:00 and after 18:00.In the bottom section that controls the ST Chat widget, insert the ST Chat to text Code.


The SE chat will appear for the times listed and all other times the ST chat will appear.



<script>

    var hour_of_day = new Date().getHours();

    var day_of_week = new Date().getDay();

    if (day_of_week == 0 || 

        day_of_week == 1 && hour_of_day <= 7 || 

        day_of_week == 1 && hour_of_day >= 18 || 

        day_of_week == 2 && hour_of_day <= 7 || 

        day_of_week == 2 && hour_of_day >= 18 || 

        day_of_week == 3 && hour_of_day <= 7 || 

        day_of_week == 3 && hour_of_day >= 18 || 

        day_of_week == 4 && hour_of_day <= 7 || 

        day_of_week == 4 && hour_of_day >= 18 || 

        day_of_week == 5 && hour_of_day <= 7 || 

        day_of_week == 5 && hour_of_day >= 18 || 

        day_of_week == 6) {

            

WebChat.loadChat({ apiKey: 'insertchatkey', primaryAccentColor: '#888888', autoOpen: true, autoOpenMobile: false, mobileHeightPercentage: 75, autoOpenExpiration: 1, title: 'Hi and welcome to Company Name, what can I help you with today?', initialMessage: [] });

  }

  else {(function(q,w,e,r,t,y,u){q[t]=q[t]||function(){(q[t].q = q[t].q || []).push(arguments)};

    q[t].l=1*new Date();y=w.createElement(e);u=w.getElementsByTagName(e)[0];y.async=true;

    y.src=r;u.parentNode.insertBefore(y,u);q[t]('init', 'xxxxxxxxxxxxxxxxxx');

  })(window, document, 'script', 'https://static.servicetitan.com/text2chat/shim.js', 'T2CWidgetManager');t>