Skip to main content
Answered

How to refresh messenger correctly for SPA?

  • July 18, 2022
  • 1 reply
  • 272 views

We've got an SPA with different articles per page, we've set up rules to change the articles in the messenger dependant on the current URL, and when the route is changed we fire the 'update' including a timestamp back to Intercom.

 

This works ok if the messenger starts closed and is then opened up (the correct articles for the current URL will show). But if the messenger is already opened on the first page and has loaded the articles, when toggling to the new page nothing changes until toggling the messenger closed then opened again.

 

Toggling the messenger in the front end feels like the wrong solution, is there a right one? 😇

 

Thanks

Best answer by Daniel M15

Hey @user1364​! Daniel from Customer Support Engineering here 🔧 

 

What I think you can do here is refresh the Messenger via code, so that when your URL changes, the Messenger is refreshed for the new URL. You can call an update using our JavaScript API ('update') method. This should hopefully show the proper article to your users 🤞

 

Hope this helps!

View original
Did this topic help you find an answer to your question?

1 reply

Daniel M15
Employee
  • Employee
  • 240 replies
  • Answer
  • July 20, 2022

Hey @user1364​! Daniel from Customer Support Engineering here 🔧 

 

What I think you can do here is refresh the Messenger via code, so that when your URL changes, the Messenger is refreshed for the new URL. You can call an update using our JavaScript API ('update') method. This should hopefully show the proper article to your users 🤞

 

Hope this helps!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings