Using Informizely on Single Page Applications

A Single Page Application (SPA) is a Web app that loads a single HTML page and dynamically updates that page as the user interacts with the app, without reloading the page. Often a Single Page Application also updates the page URL dynamically, so that the correct content is shown when the page is refreshed or saved as a bookmark.

Tracking URL changes on a Single Page Application

For URL targeting to work on a SPA you need to tell Informizely that your site is a Single Page Application. The Informizely code on your site will then monitor dynamic changes to the page URL and treat each change as a 'page reload', so that all targeting settings are checked again when the URL changes.

To turn on the SPA option, go to your Site's settings page and click the "Advanced" button in the Site's panel. In the dialog that is shown you can turn on (or off) the "Is Single Page Application" checkbox.

If the SPA option is on and the page URL changes while a survey is currently showing, the active survey will remain showing if its URL targeting settings allow the new URL. If the active survey is not targeted to the new URL it will be closed.

Using other triggers than URL changes to show a survey

Besides targeting a survey to certain URLs, you can also use custom JavaScript properties or our Widget API to trigger a survey at a certain moment.