Static website (default)
On load (default):
Executes when the page loads. This is the default and works great as long as you are not running a Single Page Application.
Dynamic website
In order to run your A/B test or personalization successful on dynamic pages built with frameworks like REACT or Angular you need to turn on our Single page application alternatives in the audience.
On load & URL change:
This is our automatic way of handling Single Page Applications. This might work well if your URL changes when the visitor navigates.
Please make sure to open up a preview for your project and check that your changes work on navigation between pages where Audience should be true and pages where Audience should be false, and vice versa. If this doesn't work well, please use Manual mode (see below).
Manual activation:
The ”On load & URL change” works great most of the time but sometimes it takes a while after the URL has changed until the new content is loaded. Then it might be better to make a callback to SiteGainer from the app when new content is loaded and Audience should be checked again. This is done by calling sitegainer.newPage(); when content is changed on the site. This callback should be placed at the same spot you probably added the event push for Google Analytics that tracks Page Visits.
Doing changes on dynamic websites