Recommender SPA implementation issues.
We’re running into an issue with the recommenders with our SPA (Singe Page Application) implementation using ReactJS. The problem is that recommenders only show in the SPA when the page is refreshed. This seems to be related to how the different calls are being made into target.
For the initial load of a page, the page load request is sent but for all subsequent pages, just the triggerView call is sent. This is because for a SPA the page doesn’t reload, it just changes the content in the views. In my testing it seems that ONLY the page load request seems to load the recommenders, not the triggerView. I did some debugging of the launch code and it seems to have confirmed it. When trigger view is called, it just tries to load and view changes out of the local cache and then tries to render it. For something like an A/B test there are changes present and are rendered accordingly. For recommenders however, there isn’t an entry stored in that local cache and the recommenders aren’t loaded.
I’ve attempted to use the getOffer call to refresh the cache, however that doesn’t seem to work either. What this boils down to is 2 questions.
- Do recommenders work properly with SPAs?
- If they do what is the proper call to make for any call after the initial page load to make sure the recommender is loaded correctly?