ConnectOnPageLoad: Configuration best practices for common use cases

Return to top
Have more questions? Submit a request

5 Comments

  • Jon

    Let's say I'm using connectOnPageLoad = false, is there a recommended way to programmatically tell the widget to load via JavaScript, if it hasn't been loaded yet?

    The use case here would be to get the best of both worlds. If a user is already chatting, I'm assuming the widget will be smart enough to load / connect automatically on subsequent page loads even with connectOnPageLoad = false, is that right? If so, that's great, but as you've mentioned, you lose out on analytics and proactive chat. If I'm actively monitoring requests on the page, I may know when the page has become idle, so I could trigger the widget to connect once all the critical resources are ready.

    0
  • Shashank Johri

    Hi Jon 

    Thanks for the question.

    1. If a visitor is already chatting and then that visitor browse to a page where connectOnPageLoad = false, then widget is smart enough to load / connect automatically on subsequent page loads. Chat will continue. As visitor is already chatting, that visitor will be counted in analytics. 
    2. Proactive chats, and analytics will always work on pages with connectOnPageLoad = true. Proactive chats and analytics will only work on pages with connectOnPageLoad = false when visitors has already clicked on web-widget on these pages. 

    Hope it helps !


    Thanks 
    Shashank

     

    0
  • Jon

    Hi Shashank,

    Thanks for clarifying the expected behavior of the boolean configuration for connectOnPageLoad.

    My other question about this was if it was possible to connect programmatically. If you set connectOnPageLoad to false and there are no chats in progress, is there a JavaScript API call to tell the widget to connect manually? The use case here is just to delay connecting, but to trigger it when we want. For example, we might trigger connection once all the essential assets on the page have loaded.

    Thanks,
    Jon

    0
  • Shashank Johri

    Hi Jon 

    Currently, we do not have any JS API to support such use case. 

    Thanks
    Shashank

    0
  • Matthijs Meijer

    Hi,

    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?

    Regards,
    Matthijs

    1

Please sign in to leave a comment.

Powered by Zendesk