Page tracking for SPA
If you are running your webshop as a Single Page Applications (SPA), the Hello Retail partner script is typically not reloaded automatically when a visitor is triggering a new page view. To ensure Hello Retail is picking up a new page view, you’ll have to ensure to call the
reload()is called after the page navigation has happened, meaning that any new content we need has been injected, any DOM elements that we're tying, e.g., recommendations, are present, and the URL has been updated. The reload call will trigger a post-request to
https://core.helloretail.com/partner/init.html.Check the network log in your browser, and ensure that the URL value in the form data matches the new page. If it does not, view tracking will not work correctly, and recommendations would load for the wrong products.
// Trigger reload, to track a new page-view