How do I show the Web Widget (Classic) on click?

Return to top
Have more questions? Submit a request

13 Comments

  • Meghan Mahar

    Hi Anna. This may be exactly what I'm looking for. When the widget appears, will it show the widget button that users will need to then click or will the widget be open automatically?

    0
  • rjones

    Unfortunately, this merely hides the widget button then shows it. I'm also looking for a way to launch the widget without using the default button.

    0
  • rjones
    If you want to hide the button follow the steps given above but in Step 7. instead of 
    zE.show();

     use this:
    zE.activate({hideOnClose: true});

     
     
    0
  • Laksh Parab

    This requires to load widget script on every page, and then just show or hide on click event. Is there anyway to load widget from zendesk on click event and them immediately activate it?

    0
  • Eric Ypsilantis

    Laksh ended up following up in a ticket, but I wanted to share what I suggested here as well for those reading the article. We support the option to use Google Tag Manager to inject the embed snippet, per this documentation:

    https://developer.zendesk.com/embeddables/docs/widget/gtm

    So you would be able to use the "Fire On Step" logic in GTM to determine when to add the necessary embed codeblock and other custom code you wish to implement. I hope this helps out with your customization efforts!

    0
  • Laksh Parab

    @Eric But that will increase application dependencies on third party controls

    Krassmann, Konstantin has suggestion here

     

    I have not tried it.

    Solution: Dont forget to set the ID of the inserted script Tag ("ze-snippet")

    var s,
    r,
    t;
    r = false;
    s = document.createElement('script');
    s.id="ze-snippet";
    var head = document.getElementsByTagName("head")[0];
    head.appendChild(s);
    s.type = 'text/javascript';
    s.src = <your url with key>;
    0
  • Giladiskon Support

    Can anyone confirm whether the button link can open an active chat window or just show the widget button? Thanks.

    0
  • Brett Bowser
    Zendesk Community Team

    Hi Giladiskon Support,

    There isn't a way to accomplish this natively, however, you may be able to set this up using the Chat API. I'd recommend you take a look at our Product Managers comment in the following post which addresses this: How to trigger a chat after the user clicks on the widget

    Hope this helps!

    0
  • Eric Uldall

    In case someone else comes across this somewhat old thread and still wants to be able to programmatically open the web widget, I've used the following which works fine...

    document.getElementById('launcher').contentWindow.document.getElementById('Embed').getElementsByTagName('button')[0].click();

     I can't guarantee how long this will work as I doubt Zendesk would consider this method "officially supported", so use it at your own risk.

    0
  • Shweta

    How can I close the web widget when I click anywhere outside that widget?

    0
  • DJ Buenavista Jr.
    Zendesk Customer Advocate

    Hi Shweta,

    Thank you for reaching out to Zendesk Support.

    In regards to your questions, I believe the following information is available from this article. If you're looking to hide the Web Widget on click, instead of showing it. You can modify/edit the following line id="showWidget" to "hideWidget".

    Again, just a disclaimer Zendesk does not support or guarantee the code. Zendesk also can't provide support for third-party technologies such as JavaScript, jQuery, or CSS.

    Thank you and have a wonderful day ahead!

    Kind regards,

    DJ Buenavista Jr. |
    Customer Advocacy Specialist 

    0
  • raffaello

    Hi Everyone,

    we have a similar need. We would like to be able to open at the click on the link the main page containing all types of ticket form or directly on the ticket form present on the web widget to try to divert in the best way the consumers. We don't understand how to implement the script in order to make the web widget receive the function.

    Any suggestions? :)

     

    0
  • Ram Claudio
    Zendesk Customer Advocate

    Hello there Raffaelo, to allow the widget to start with the ticket form or a selection of the ticket form as soon as it has been activated. Your widget settings should only have Contact form enabled. (This means disabling Help Center, Chat Talk). Hope this helps!

    0

Please sign in to leave a comment.

Powered by Zendesk