This is an old revision of the document!
Freshchat
To use freshchat widget add this code to the custom script section:
// BEGINNING OF FRESHCHAT WIDGET // var freshchathost = "<FRESHCHAT_HOST>"; var freshchattoken = "<FRESHCHAT_TOKEN>"; function initFreshChat() { window.fcWidget.init({ token: freshchattoken, host: freshchathost }); } function initialize(i,t){var e;i.getElementById(t)?initFreshChat():((e=i.createElement("script")).id=t,e.async=!0,e.src=freshchathost+"/js/widget.js",e.onload=initFreshChat,i.head.appendChild(e))}function initiateCall(){initialize(document,"freshchat-js-sdk")}initiateCall(); document.body.addEventListener("userLogIn", function(e){ const user = e.detail; window.fcWidget.setExternalId(user.id); window.fcWidget.user.setFirstName(user.displayName); window.fcWidget.user.setEmail(user.email); }); // END OF FRESHCHAT WIDGET //
To make it work for your case, insert freshchat host and token in these lines only:
var freshchathost = "<FRESHCHAT_HOST>"; var freshchattoken = "<FRESHCHAT_TOKEN>";