Can the chat widget be enabled from a URL? | Community
Skip to main content

Can the chat widget be enabled from a URL?

  • June 21, 2018
  • 3 replies
  • 0 views

Can the chat widget be enabled from a URL (or button)? i.e. I don't want to place the widget script in the head tag and therefore display the chat button at the bottom of the page. I want the chat widget to popup when the user click an button I've created in the top nav of my site.

This topic has been closed for replies.

3 replies

  • June 22, 2018

Hi Greg, 

Good question, there are two approaches to accomplish this. You can use the Javascript APIs to trigger the chat widget to appear on a button click (this is what we do ourselves when you ask for chat support in the Chat dashboard) or you can use triggers to send a proactive message and appear based on a specific URL condition.

Under the Widget Settings screen, you will first need to turn on the Hide Widget setting:

For the button in your nav, you will need to use the window.show JS API: https://api.zopim.com/files/meshim/widget/controllers/liveChatAPI/Window-js.html#$zopim.livechat.window.show

If you want to go the trigger route, you will just need to create a trigger that sends a proactive messages based on the specific URL condition you want. You can learn more about triggers here: https://chat.zendesk.com/hc/en-us/articles/212679627-Working-with-triggers

-Ramin

 


  • November 12, 2018

Hello, 

I would like to accomplish a similar thing. I have a single page application and would like to show the widget on the route 'wiki/help' and nowhere else. I was planning to hide the widget by default and then trigger it when the user visits the said URL. However, I don't see the "Hide Widget" section in the settings:

Has this since been removed or am I missing something. If it has indeed been removed, could you please propose an alternate solution?

Regards, Filip


  • November 13, 2018

Hi there Filip,

The Hide Widget setting is only available to accounts using the Chat standalone widget, you are using the Web Widget.

To hide the Web Widget, you will need to use a JS API. The docs can be found here: https://developer.zendesk.com/embeddables/docs/widget/core#hide

If you are using a single page app, ensure that you are also using the sendVisitorPath API so that it detects the page changes and triggers can fire appropriately based on the end user's actions: https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#sendVisitorPath

-Ramin