JS Function

Hi there,

We are trying to integrate Live Agent (our chat software) with Answerly by running a code for the human takeover part. Can you please tell me what JS function is used to close the Answerly chat widget? Similarly, please let me know as well what JS function is used to open the Answerly widget.

Thank you.

@Simone I’d like to follow up on this please?

Hi Jedi

Sure, apologies for the late response

To remove the chatwidget
Answerly.Chatbot.destroy()

To open or close
Answerly.Chatbot.toggle()

Hi Simone,

I added the code you gave me to the script provided by Live Agent that’s supposed to make Answerly work with Live Agent. However, after trying this out it doesn’t seem to work. I reached out to Live Agent support so they can test this on their end. Here’s what they said:

I checked the scripts that you sent me, and they seem to be correct. Also, the chat window is opened on your website when I run chatButton.onClick() function in the developer console (unfortunately I wasn’t able to get the option to start a chat through the chatbot, I think because I checked it outside of office hours).

However the Answerly.Chatbot.toggle() function is not working and returning errors in the console. The other function from Answerly is working correctly. I suggest contacting their support to verify this with them. You can also ask how the functions (to open our chat window, and close their chatbot) should be run from the chatbot’s interface, they might be able to provide better answer for this.


The scripts I used are found here. Can you please have a look and possibly sort out why this isn’t working?

  1. Script 1 - I placed this in the tags of customers.com.au
  2. Script 2 - I placed this in the chatbot settings under ‘human takeover’

Thank you.