The web messenger in Freshchat also known as the conversations widget, is used to deliver a convenient and contextual conversational messaging experience for customers.
If you want the widget to load async you will need to use the modified code below.
<script>
function initFreshChat() {
window.fcWidget.init({
token: "WEB_CHAT_TOKEN",
host: "WEB_CHAT_HOST"
});
}
(function(d, id) {
var fcJS;
if (d.getElementById(id)) {
initFreshChat();
return;
}
fcJS = d.createElement('script');
fcJS.id = id;
fcJS.async = true;
fcJS.src = 'https://wchat.freshchat.com/js/widget.js';
fcJS.onload = initFreshChat;
d.head.appendChild(fcJS);
}(document, 'freshchat-js-sdk'));
</script>The above code should be added before the </body> tag of your website's HTML.