Chat Widget: Fire an event on widget being loaded / recognize that no widget has been shown

Hi!
Our company’s customer is using the Zammad chat (we don’t have direct access to it unfortunately so I cannot readily supply details about its versions).
We would like to be able to react to the widget being or not being instantiated in the page so what we can consider it in the page design.

Could you please tell me if there is a preferred way to detect whether the chat has instantiated it has refused to load (such as when no chat agents are available)? Currently, we are using a mutation observer do detect the chat’s widget - which is not completely robust with respect t timing or in detecting that the Chat didn’t and won’t come (no agents).
I have noticed the onOpen hook that can be supplied with the options, but failed to have it fire. Is there anything that I need to consider in order to use it - and is it meant to fire on opening the chat window (i.e. when a customer actually clicked in the widget) or on the widget connecting to the chat server as it seems to be from the code?

I am grateful for any hint! :slight_smile:

Thank you, best regards
kleena_k

You can find Zammads relevant javascript files here:

However, there’s no native way to allow the widget to tell other things “Here I am” - I’m afraid you have to hook into that or possibly check for Zammads injected objects for changes or specific states.

Not really something I can help you with, out of my technical scope sorry.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.