[ARCHIVED] How to trigger a chat after the user clicks on the widget | Community
Skip to main content

[ARCHIVED] How to trigger a chat after the user clicks on the widget

  • March 11, 2019
  • 2 replies
  • 0 views

Is there a way to trigger a chat to a user after they click on the widget, but before they've sent a chat?  For example, as soon as the user has opened the widget, I want to trigger a message saying "How can I help you?" before they've started chatting.  But I don't want to send that message to all users before they've clicked on the widget. 

2 replies

  • March 12, 2019

Hi Harvey,

Although there is no native trigger condition to do what you want, you should be able to use a combination of two Javascript APIs to achieve what you want.

First, you will want to use the https://api.zopim.com/files/meshim/widget/controllers/liveChatAPI/Window-js.html#$zopim.livechat.window.onShow callback URL to detect when the window is open. From there, you will want to add a tag using https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#addTags.

From there, you just create a trigger that fires based on the tag being present and just ensure that it is set to fire only once per visitor. 

-Ramin

 


  • May 23, 2019

Hello,

 

So I've tried to apply the trick you recommended but the problem is that the tags wouldnt be added until the conversation is initiated (got this info from the zendesk support team). But even if they are added on the window show event before any messages are sent, the trigger is run when the widget is loaded ; meanwhile the tags are added when the widget is clicked so the tag condition would be never satisfied! Is there any way around this?

Thanks a lot.

 

-- Mohamed