Hide Web Widget
AnsweredHi,
After moving to the new ZenDesk integrate chat experience, how do we hide the web widget, while being able to open the chat window only from our own code?
Currently, I can do: zE('webWidget', 'hide'), and then when I want to open, I can do: zE("webWidget", "show"); zE("webWidget", "open");, but when the user minimizes the window, the widget is again visible which we don't want.
In the previous version we were able to handle the launcher widget separately from the chat window. How do we do that in the current version?
-
Hi Lambo.
Would you be comfortable exposing the full piece of code regarding the Widget, then I can take a look.
#helpsome regards,
Thomas de SilvaZendesk Consultant @ helphouse.io
-
Hi Thomas,
That's pretty much the full piece of code:
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=XXXXX"></script>
<script type="text/javascript">zE('webWidget', 'hide');</script>
Then elsewhere, I have other functionality to open the chat window where I call:
zE("webWidget", "open"); -
Hey Lambo,
This is indeed possible. You can use the command "on close". Below is my explanation on how I did it.
1. For some reason, the following code didn't work without actually c/p the Widget inclusion script in the header. So do this.
2. Hide the widget from start, as you already do:
zE('webWidget', 'hide');3. Implement button to open the widget in the state you want, like you already do:
<button onclick="zE('webWidget', 'show')">Show Web Widget</button>4. The functionality of closing the widget completely once the end-user minimizes it, do the following: zE('webWidget:on', 'close', function() {
zE('webWidget', 'hide');
});#helpsome regards,
Simon Blouner
Zendesk Consultant @ helphouse.io
Post is closed for comments.
3 Comments