Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change visitor ID #30

Open
mathiastm opened this issue Nov 28, 2019 · 4 comments
Open

Change visitor ID #30

mathiastm opened this issue Nov 28, 2019 · 4 comments

Comments

@mathiastm
Copy link

Hi,
I'm trying to set department switch the button clicked by the user.
Scenario Example :
User click on "Department 1" => start chat with the agent in the "department 1" => user leave the chat => user click on "Department 2" => {here is my problem} user should start chat with the agent in "department 2" but the chat is started with the agent on "department 1" instead....

If I reload the page, the visitor id change and if user click on "Department 2" everything works fine.
So I'm searching for a solution to force Visitor department Or to reset Visitor id when user leave the chat the first time....

thanks

@rshokrizadeh
Copy link
Contributor

Hi @mathiastm are you testing your widget in localhost? The visitor ID should not be changing on refresh unless the cookie is lost or you are testing on localhost. If you are testing in localhost, please check the docs on the repo as it explains how you can test locally.

Also, are you running the custom widget in a single page app which isn't triggering the page change?

@mathiastm
Copy link
Author

Hi @rshokrizadeh , thank you for your quick reply.
Yes I'm running the widget in a single page app.
On the "chat.memberjoin" event, I log the department Id and it is correctly set. but still received on the wrong department... I don't know why.

@rshokrizadeh
Copy link
Contributor

Thanks for the update. There is a known constraint today with single page apps and department selections, since the update requires a page change/refresh. The dev team responsible for the Web SDK may look into better supporting SPA in the coming weeks and will update this thread once the change has gone out. In the mean time, you would need to trigger a refresh in the widget/iframe to get the department change to work correctly.

@mathiastm
Copy link
Author

Thank you. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants