When you feel that that your visitor will be distracted if there’s chat widget on a page that has pop-ups and infographics. With a help of a visitor API you can customize and control various aspects of your chat widget accordingly.


If your widget is installed, then skip 1 & 2


  1. Login to your Freshchat account as an Owner or Manager

  2. Go to Settings -> Installation Snippet, Copy and paste the Installation Snippet before the last body tag in your website


Once you paste the script into your website, ensure you call Freshchat functions after the script loads onto your web page. 


These are some of the ways in which you can access Freshchat functions:


window.onload = function(){

//Freshchat functions

}



If you are using jquery,


$(window).load(function(){

//Freshchat functions

})



Or, if you’re using Onreadystatechange event,


document.onreadystatechange = function(){

if(document.readystate === ‘complete’){

//Freshchat functions

}

}


Here is how you hide widget using Freshchat.hideChat() function


Screen Shot 2017-02-13 at 5.18.28 PM.png




If you want to customize your web page after maximizing the widget, you can refer to this sample scenario:


Hide chat code.png