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 tracking when the visitor views a new page you should call the trackPageView
on every page change.
If you want to use our managed product recommendations, search or category pages you will have to ensure that the reload
SDK method is called on every page view. This will trigger the following things
- Remove any content managed that was already injected
- Track the page view
- Inject any product recommendations that are configured to load on the new page
- Execute all managed search configurations again
- Execute all managed category pages again
When the script reloads it will look at the DOM to figure out what recoms should be injected. So it is important to call reload
after the DOM changes that the visitors navigation triggered have completed.
You trigger a reload using by sending the reload command to the command queue:
hrq = window.hrq || [];
hrq.push([
"reload"
]);