Start a conversation

Restricting Messenger Display on Help Center

Overview

You can restrict the messenger in your Help Center to display only at certain times of the day or only during business hours and turn it off during non-business hours.  You may also restrict the messenger so that live chat can be offered only to users who are logged in. Or, you can disable it and turn it off completely.

 


 

 

Diagnosis

Real-time support can eat up a lot of your resources, so sometimes you want to be able to offer it only at particular times or to specific customers. With a little bit of light editing to your Help Center templates, you can achieve either of these goals.

Whether you want to restrict Messenger by the time of day, or by whether or not a user is logged in, the process is virtually the same. First, turn off the switch that automatically displays Messenger. Then generate a Messenger embed code manually. And finally, add that code block to your Help Center templates surrounded by a pair of tags that will check either the time of day or whether the user is logged in or not. 

 

Back to top


 

Prerequisites

  • To edit the messenger configuration, you will need an administrator account with the 'Manage channels' permission.
  • Skills and knowledge of the PHP scripting language and JavaScript.

 

Back to top


 

Solution

To restrict Messenger, follow the below steps:

  1. Sign in to Kayako and go to your Help Center. 

  2. Click the Customize button on the top toolbar.

    mceclip0.png

  3. Click Settings and set the Show messenger toggle to 'No'.
    • NOTE: If you simply want to stop the messenger from displaying on your Help Center, you can end the process here.

      1.png
  4. Switch to the admin area, and click Configure under the 'MESSENGER' heading.

    mceclip1.png

  5. Go through the steps to generate a new Messenger embed code. You can find detailed instructions for that process in our user guide article on the subject.

  6. When you are done customizing Messenger, copy the embed code you generate and drop it in a text file.

  7. Switch back to the Help Center. 

  8. Click Customize again in the upper-right, and then Customize templates.

    mceclip2.png

  9. From the Template drop-down, select Footer.

    2.png
  10. At the bottom of the template locate the final </div> tag. 

  11. Immediately above that tag, you are going to add one of the following pairs of tags:

    To use a date filter to only display Messenger at a certain time of the day (e.g., between 9 am and 7 pm):

    {% if ("now"|date("H") >= 9) and ("now"|date("H") <= 19) %}
    
    {% endif %}
    To use a date filter to only display Messenger on weekdays:
    {% if ("now"|date("N") >= 1) and ("now"|date("N") <= 5) %}
    
    {% endif %}
    You can change the beginning and ending hours by changing the numerals in the
    {% if %} tag.

    Note: To read more about the kinds of parameters you can use with date, please review the article from the PHP documentation site about 'date'

    To restrict Messenger only to users who are logged into the Help Center:
    {% if current_user is defined %}
    
    {% endif %}
  12. Whichever restriction you are using, your last step is to paste your Messenger embed code block (the one you copied in step #6) between the {% if %} and {% endif %} tags.

  13. Click the Save button at the top of the customize pane.

 

It is worth noting though that the steps above controls the messenger visibility on the Help Center ONLY. If you added the messenger to your external website, you need to create a Javascript function using the following function: kayako.hide(). For more information please be sure to read our Messenger article about Methods.

Once you have these code blocks in place, you should be able to hide the messenger code outside the business hours and avoid live chat messages originating from them.

 

Back to top


 

Confirmation

Your Messenger icon will now only display either during the hours you specified or only to visitors who are logged into your Help Center. 

 VadwUz8VcA1sCxbNBlsPEmuahMo4RvWN.png

 

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted

Comments