Single page applications (SPAs)
RightMessage detects client-side route changes automatically and personalizes the new page before it is displayed. No router code or route-change hook is needed.
This includes URL changes through the History API (history.pushState and history.replaceState), browser back and forward navigation (popstate), hash changes (hashchange), and the Navigation API (navigatesuccess).
Keep your RightMessage installation script. If you previously added a route-change reset in React, Next.js, Vue, Angular, or another framework, remove that hook.
For script placement, follow our SPA installation guide.
App-state changes without a URL change
Use RM.push(['reset']) or RightMessage.reset() only when application state changes without a URL change, such as a login that changes data a Flow reads. Route changes do not need a manual reset.
Verify client-side navigation
Navigate between routes in your application, including browser back and forward navigation.
Check that personalizations and Flows update for the new page.
Check that widgets follow the new page's URL rules.
If something is not updating, check that your RightMessage script is loaded and look for browser console errors. Contact [email protected] with your framework and version, the affected URL, what you expect to happen, and any console errors.