Question
I need to hide or remove the option to chat with my agents from some pages of my website but keep it on other pages; how do I do that?
Answer
If you would like to remove your widget from a webpage altogether, simply remove the widget source code from that web page. For more information, see the article: Removing Web Widget (Classic) from your website or help center.
If you would like to keep your widget on all pages of your website but remove the option to live chat with your agents from only some of the pages, that is possible as well. If you have the Web Widget, you can use the suppress code as described in this article: Advanced customization of the Web Widget. If you have a chat-only account, follow the directions in the article: Showing and hiding the Chat window.
6 comments
Tom Derbyshire
Is there a way to have the code on all pages but only show on certain pages so that the chat resumes if a user goes from a page with the chat widget to a page without the chat widget so we don't get cut off? Thanks!
0
Erica Girges
Thanks for posting your question to the Community. You could use on chat:unreadMessages to listen for chat notifications coupled with window.location.pathname to track which page the user is on then toggle hide/show for the chat widget based on your needs. Here are the links to the how to hide/show the chat widget.
Another solution, you could just use z-index on the chat widget to move it from the front or back of the page. You'll still want to track chat notifications and location as well though to determine when to change the z-index value.
Hope this helps!
Erica
0
Carmelo Rigatuso
Is there a way to suppress the widget one one particular form in the help center? For example, I want to suppress the widget on https://helpcenter.mycompany.com/hc/en-us/requests/new?ticket_form_id=1111111111, but not on https://helpcenter.mycompany.com/hc/en-us/requests/new?ticket_form_id=2222222, etc.
Would some sort of IF/THEN or CASE in the new_request_page.hbs do it?
0
Mike DR
You're correct, it would require custom coding to create the IF/THEN statement to hide the widget for particular forms. Here's the code for hiding the web widget:
zE('messenger', 'hide');
Article for reference: Core messaging Web Widget API
0
Shirley Xiao
Hi, I wanted to confirm something regarding the messenger and how it acts with hide/show.
In our app at a certain breakpoint and below we hide the messager, for smaller devices. When this happens they can open zendesk messenger again if they click on our support button from a dropdown menu, we did something like this to create that experience:
zE('messenger', 'hide');
zE('messenger:on', 'open', () => {
zE('messenger', 'show');
});
zE('messenger:on', 'close', () => {
zE('messenger', 'hide');
});
However, once they close Zendesk messager we want the messenger to be hidden again, but we briefly see the zendesk bubble before it gets hidden. Is this the expected behavior of the messenger? e.g when users close the messenger the bubble is shown by default so we briefly see the messenger before it is hidden.
0
Destiny
Thank you for reaching out.
Yes, the behavior you are describing with the Zendesk Messenger is expected when using the JavaScript API to control its visibility. When you call the
zendeskAPI('messenger', 'close')
method, it triggers the closing animation of the Messenger window, and if you are not callingzendeskAPI('messenger', 'hide')
until the 'close' event gets fired, the default state after closing the Messenger is to show the launcher bubble, which is why you might briefly see the bubble before it gets hidden.Your code is attempting to immediately hide the bubble after closing, but there can be a short delay causing the bubble to appear momentarily. This is due to the lifecycle of the messenger's animations and the event handling by the browser's JavaScript engine.
I hope this information helps.
0