Hash routing or PushState based Single Page Application
If you are using pushState API of HTML5, or using a simple hash routing for Single Page Applications (we will call this type of SPA a Simple Single Page Application
), we provide a setting on our SDK so that it could track users transitioning to a new page.
// You can reference other custom configurations on $p("init") documentation.
var customConfig = {
config: {
sdk: {
pushStateReset: true
}
}
}
$p("init","JS_KEY",customConfig)
Setting this to true will reset our client to a status of initial pageview after the url hash is changed, or history.pushState
function is invoked.
Other Implementations
If your Single Page Application has a heavily customized user flow (non-Simple), then most of Single Page Application Integration is about directly invoking things such as cookie update or pageview since our script won't be loaded/initialized between "page" transition.
$p
functions documented in this section will help you in sending activities and querying recommendations to LiftIgniter.