Single Page Application Data Values
How to Track Virtual Page Views Through Pubfig
Pubfig version 4.6.0 +
Pubfig.js collects data values such as URL location which is then used in various tables. In order to properly track data sites that are using Single Page Applications (SPAs), or sites with slideshows/carousels that change URLs / URL parameters the publisher must take these new actions to assure the accuracy of the collected data.
When the location and or URL is updated, the lifecycle of the DOM and or Window does not reload the pubfig.js script. In order to address this, the publisher must invoke the freestar.trackPageview() method. This will ensure that the new URL is stored and used throughout the data collection for that page or view.
In order to fend off timing issues, the function must be invoked within the Freestar queue. e.g.:
// (1) new view / url state updated // (2) upon completion of the view being mounted invocation of the trackPageview method within the queued method freestar.queue.push(function(){ freestar.trackPageview() });