Can I reconnect to chat session after page reload?

답변함

12 댓글

  • Ramin Shokrizadeh
    댓글 작업 고유 링크

    Hi Artur,

    The widget will persist the session across pages when it is on the same domain. Are you testing the widget and your website on localhost? This would not work and we would suggest testing it with an IP address or an internal testing domain.

    A domain is required to persist the cookie identity of the visitor and the cookie can't persist when testing on localhost.

    -Ramin

     

    0
  • Arozwalak Landbay
    댓글 작업 고유 링크

    Hi Ramin,

    thanks for the reply. I'll try this way.

    0
  • Henry Lee
    댓글 작업 고유 링크

    Hi Ramin,

     

    I am having this issue as well and was wondering if I could get your feedback.

    We are currently using the Zendesk Chat Widget SDK for a React single page application. When a user clicks on the "Proceed to Checkout" button, it redirects to a Shopify domain, but we would like the chat session started on the React Application to persist over to the Shopify domain.

     

    Would you happen to know if each chat session is tagged with a unique ID so that we can use that ID with an API to reconnect to the same chat session and continue it on the Shopify domain?

     

    We want to be able to continue the chat started on our React Single Page Application over to the Shopify domain.

    0
  • Ramin Shokrizadeh
    댓글 작업 고유 링크

    Hi Henry,

    I have answered the question here: https://chat.zendesk.com/hc/en-us/articles/360001352868/comments/360001239908

    -Ramin

    0
  • Ron Farber-Newman
    댓글 작업 고유 링크

    Ramin, any chance you could post an updated link that talks about how you could persist the chat session with an ID? The one in your previous comment is a dead link.

    0
  • Ramin Shokrizadeh
    댓글 작업 고유 링크

    @Ron There is no way to persist a session or specify an ID. Can you elaborate on what you want to achieve? Thanks.

    0
  • Ron Farber-Newman
    댓글 작업 고유 링크

    @Ramin We currently have a method in our JS that reopens the chat if a chat is in progress via the old $zopim API:

    if ($zopim.livechat.isChatting()) {
        $zopim.livechat.window.show();
    }

    We are currently trying to embed the Zendesk Chat window into our own widget to be part of a larger support widget related to our internal Learning Management System, and want to trigger the Zendesk Chat experience programatically via API. That part is working great.

    But when the page is refreshed, the chat session is lost. I've tried both on localhost as well as on a staging link and both produce the same results. The cookies/local storage values from Zendesk are there in both cases.

    I can't figure out how our current usage persists the chat on page reload. That's what we're trying to recreate. 

    Any chance we could hop on a call/Zoom meeting for me to explain this in more detail? I have an open ticket with Jason S and our company has phone support with you guys, FYI.

    Thanks!

    0
  • Ramin Shokrizadeh
    댓글 작업 고유 링크

    Chat does not support localhost since the cookie that stores the visitor cookie requires a domain. Testing on localhost will get the results you are seeing, new visitor/chat on refresh or page change.

    If you are building a custom widget, you should use the Web SDK and you can use the APIs to get the connection status:

    https://api.zopim.com/web-sdk/#zchat-getconnectionstatus

    https://api.zopim.com/web-sdk/#zchat-ischatting

    If you have more questions, please continue the conversation on the ticket and the advocacy team will help you out.

    -Ramin

     

    0
  • Ron Farber-Newman
    댓글 작업 고유 링크

    Ramin, I still have the same issues on my staging site that isn't localhost. I think I've tracked my issue down to using the following a setting in my config.

    We're using...
    window.zEPopout = true;
    ... in our setup config settings to get the chat widget to fill the window without any of the other bells and whistles. When this is omitted, the chat persistence on my staging link works! But when it's added, it doesn't work. Is there any way to get chat to persist in tandem with zEPopout set to true; or another way to get the chat to fill its iframe?

    Ron

    0
  • Ramin Shokrizadeh
    댓글 작업 고유 링크

    Hi Ron,

    The advocacy team will help you out on your open ticket #4663634.

    -Ramin

    0
  • Gal Zohar
    댓글 작업 고유 링크

    Ramin Shokrizadeh

    Many developers will test on 'localhost' first. It just took us 2 days of frustration to find this post, switch to '127.0.0.1' and it worked immediately.

    First - thanks for the answer here, it saved us from pushing back Chat launch. 

    Second - The limitation makes sense and is easy to bypass, but it's hidden. I strongly suggest adding this to the chat API docs, where JWT is described. It should not take a lucky Google search to find out about this limitation. 

    0
  • Ramin Shokrizadeh
    댓글 작업 고유 링크

    Hi Gal,

    Thanks for sharing your feedback. We do post that in the repo for the Web SDK sample code here: https://github.com/zendesk/zopim-chat-web-sdk-sample-app#testing-locally

    We can consider adding it explicitly to the Web SDK docs as well as a future docs improvement.

    -Ramin

     

    0

댓글을 남기려면 로그인하세요.

Zendesk 제공