Optimizing Chat and Web Widget performance

Return to top
Have more questions? Submit a request


  • Matthijs Meijer


    I'm trying to use this setting but all it does is delay the loading of "chat-incoming-nootifaction.mp3".

    I'm using the following code:

    <script type="text/javascript"> window.zESettings = { webWidget: { chat: { connectOnPageLoad: false }, launcher: { chatLabel: { '*': 'Chat met ons!' } } } }; </script>

    Delay loading only the mp3 file has no, to allmost no effect on the page load.

    Am I doing something wrong?


  • Miranda Burford
    Zendesk Product Manager

    Hi Matthijs,

    Thanks for reaching out!  Right now, with this setting enabled, it will prevent the Web Widget from establishing a Web Socket connection on page load. The majority of the performance benefits for this feature are most noticeable in the Chat dashboard where agents are handling a large numbers of incoming requests from end users who are both either interacting OR not interacting with the Web Widget. With this new feature turned on, Agents will only be interacting with end users in the Chat dashboard once they have begun interacting with the Web Widget.  There are some benefits coming on the client side too.

    This work was needed as a precursor step to allow us to start dynamically loading Chat assets only once an end user begins interacting with the Web Widget as well. This should help to reduce initial bundle size and improve load times. This client side work to dynamically load the Chat assets hasn’t been completed yet but it is still on our roadmap for next year (sometime in the first half of the year).

    I'll log your details on our side and would be happy to notify you once this work has been completed.


    - Miranda.

  • Jon

    Miranda Burford I'm also interested in upcoming developments here too. We recently deployed proactive chat more broadly, and since we can't set connectOnPageLoad to false and have proactive working, we're stuck loading the widget's massive JavaScript (our total loaded JS is 5x larger overnight). This is definitely an issue for site performance an SEO.

    One suggestion - if there was a simple REST API we could use to determine if proactive chat was even worth loading, that would be a huge lifesaver. Many A/B testing platforms load optimally this way. First, a small request is made to an API with the URL of the current user, then if there's anything to do (e.g. there's an A/B test enabled for that URL, or in this case, if there are agents online and there are triggers that could be relevant for that URL), then the client can start loading more stuff.

    In other words, I wish we had an API that took a URL, and let us know if agents are online AND if any triggers could be active for that page. This way, we don't pay the loading price for proactive chat if it's not even possible at the time.

    Thank you!

  • Miranda Burford
    Zendesk Product Manager
    Hi Jon,
    Thanks for your feedback! 
    >>In other words, I wish we had an API that took a URL, and let us know if agents are online AND if any triggers >>could be active for that page. This way, we don't pay the loading price for proactive chat if it's not even >>possible at the time.
    That's a good suggestion!  The additional context you've provided is helpful.  We'll definitely log that as a feature request on our side and be in touch if we have any updates on it in the future.  
    - Miranda.
  • Daniele Gabellini

    Hi Support

    If I use Web Widget only for "Contact forms" and NOT for "Chat", can I still enable the:

    connectOnPageLoad: false

    in order to improve performance site?


  • DJ Buenavista Jr.
    Zendesk Customer Advocate

    Hi Daniele,

    Thank you for reaching out to Zendesk Support.

    In regards to your concern, the following performance benefits of using this code are mainly used in the Chat dashboard. This will help where agents are handling a large number of incoming chat requests and those who are interacting with the Web Widget.

    I don't see any issues using the following code since you will not be using chat or engaging with end-users from the web widget.

    Please don't hesitate to reach out if you have any other questions or concerns. Thank you and have a wonderful day ahead!

    Kind regards,

    DJ Buenavista Jr. |
    Customer Advocacy Specialist | Support@Zendesk.com


Please sign in to leave a comment.

Powered by Zendesk