admin:online-platform-cms:3rd-party-scripts:freshchat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
admin:online-platform-cms:3rd-party-scripts:freshchat [2020/06/17 06:47] – created algirdas-matasadmin:online-platform-cms:3rd-party-scripts:freshchat [Unknown date] (current) – external edit (Unknown date) 127.0.0.1
Line 9: Line 9:
   function initFreshChat() {   function initFreshChat() {
     window.fcWidget.init({     window.fcWidget.init({
 +      config: {
 +        "cssNames": {
 +          "widget": "custom_fc_frame"
 +        }
 +      },
       token: freshchattoken,       token: freshchattoken,
       host: freshchathost       host: freshchathost
Line 15: Line 20:
   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();   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){ +  document.body.addEventListener("userLogIn", function(e){ 
-  const user = e.detail; +    var user = e.detail; 
-  window.fcWidget.setExternalId(user.id); +    window.fcWidget.setExternalId(user.id); 
-  window.fcWidget.user.setFirstName(user.displayName); +    window.fcWidget.user.setFirstName(user.displayName); 
-  window.fcWidget.user.setEmail(user.email); +    window.fcWidget.user.setEmail(user.email); 
-});+  });
 // END OF FRESHCHAT WIDGET // // END OF FRESHCHAT WIDGET //
 </code> </code>
Line 30: Line 35:
 </code> </code>
  
 +To move the chat widget around, add this to FOOTER CONTENT: 
 +<code> 
 +<style> 
 +.custom_fc_frame { 
 +  margin: a b c d 
 +
 +.custom_fc_frame.fc-open { margin: 0 } 
 +</style> 
 +</code> 
 +where 
 +a - move down 
 +b - move left 
 +c - move up 
 +d - move right 
 +certain amount of pixels, e.g. `margin: 0 10px 10px 0` -> moves widget upwards and to the left in 10px both.
  • admin/online-platform-cms/3rd-party-scripts/freshchat.1592376448.txt.gz
  • Last modified: 2020/06/17 06:47
  • (external edit)