Digioh fully supports Single Page Apps, websites that are built as a single web page rendered by JavaScript (e.g. in Reactor AngularJS).
By default, Digioh will re-initialize on every physical page transition (traditional website model), and:
- Re-evaluate box conditions to display boxes
- Record pageview analytics events
- Run any custom JavaScript (After Document Ready)
However, with a Single Page App, there is typically only one pageview, meaning that Box Conditions such as “Display After 2 Session Pageviews” will not work as expected.
You can change Digioh to operate in SPA Mode, whereby we detect “virtual” pageviews: changing of the URL in the address bar without a physical page transition.
To enable SPA Mode, you can install an app. In the Digioh HQ, go to your profile menu top right, and select Custom JS (Apps).
Then install app #2 Single-Page-App Support, and you’re done!
Note that SPA mode only works for virtual page transitions, user interactions that cause the URL in the browser address bar to change. If you need to trigger re-initialization of Digioh for other use cases, this is possible with Custom JavaScript, let us know at support@digioh.com
For Developers
The Digioh SPA app uses this function, which you can call directly from Parent JS (After Document Ready) if you need more control:
DIGIOH_API.LIGHTBOX.onPageUrlChanged(url, send_pv_event, update_pv_based_vars, use_master_rules, re_calc_ab_tests)
//Determines whether we count each page URL change towards the pageviews analytics metric.
send_pv_event= true; //default is false.
//Determines whether we should count each page URL change towards the pageview “rules” that count towards the Conditions.
update_pv_based_vars= true; //default is false.
//Determines whether the master rules should be re-evaluated on every page URL change.
use_master_rules= false; //default false.
//Determines whether a different AB Test should be considered every time the page URL changes.
//For example, when a different Variation should/could be displayed on every page URL change.
re_calc_ab_tests = false; //default false.