Using a Text Link or Button to Open the Chat Widget

Thảo luận trong 'Automation Marketing' bắt đầu bởi KetHuynh, 10/8/17.

  1. KetHuynh

    KetHuynh Administrator Thành viên BQT

    If you do not want to use the standard embed or inline chat box, you can call a chat window from any text or button on your website.

    There are some key steps to achieve this :

    1. Add the widget code to your site just before the closing < / body > tag
    2. Add custom txt or an image to your server with the click event.
    3. Modify the widget behavior, so that it "Hides widget on load" (optional)
    4. Display a custom image or text based on your status (optional)

    Please follow these steps :

    Step 1 - Copy the Widget code
    1. Login to the dashboard
    2. Click "Admin" at the Top of the Dashboard
    3. Choose the Site from Properties Menu (if you have more than 1 site).
    4. Copy the Widget code
    5. Paste the widget code into your website HTML just before < / body >
    6. Refresh your website to ensure you see the widget.

    Step 2 - Create button or text on your site
    Create a button or text and add the following code before it:
    For a text link use :
    <a href="javascript:void(Tawk_API.toggle())"> Click to Chat </a>
    For an image use :
    <a href="javascript:void(Tawk_API.toggle())"> <img src="/path/to/img"> </a>
    Step 3 - Hide widget on load, and pop out
    1. Login to the dashboard
    2. Click Admin at the Top of the Dashboard.
    3. Select the Property from the dropdown menu (if you have more than 1 site)
    4. Click Widget Settings.(to the right just beneath the widget code)
    5. Select Hide widget on load to hide the widget before it is clicked and/or select On Click : Pop out
    6. Click Save

    Step 4 - Display a custom image or text based on your status
    If you followed Steps 1 through 3, you should now have an image or text on your site that pops out the chat when clicked, and is hidden.

    An advanced option is to show different images based on the status of your widget. Eg: Offline, show an offline image, Online, show an online image.
    1. Add this div code in to your website's HTML in the position where you would like the button or text to displayed. You do not need to add anything inside the div, just copy and paste it exactly as is.
    <div id="status"></div>
    2. Add and modify this code with your custom images and text, and place it just before the < / body > tag.

    Click Here for a working example of a text based status code.
    <!--Start of tawk.to Status Code-->

    <script type="text/javascript">
    Tawk_API = Tawk_API || {};
    Tawk_API.onStatusChange = function (status){
    if(status === 'online')
    {
    document.getElementById('status').innerHTML = '<a href="javascript:void(Tawk_API.toggle())">Online - Click to chat</a>';
    }
    else if(status === 'away')
    {
    document.getElementById('status').innerHTML = 'We are currently away';
    }
    else if(status === 'offline')
    {
    document.getElementById('status').innerHTML = 'Live chat is Offline';
    }
    };
    </script>

    <!--End of tawk.to Status Code -->
     

Chia sẻ trang này