Decibel Insight
Knowledgebase

Single Page Application Tracking

Decibel Insight can be implemented on Single Page Applications (SPAs) using technologies such as AngularJS or Backbone.js by deploying the regular Decibel Insight Tracking Code. If the application is designed using the HTML 5 History API, virtual pageviews will be automatically detected and tracked by Decibel Insight.

If the application does not change the URL to denote virtual pageviews, it will be necessary to use the trackPageView JavaScript API end-point. See below for more details.

Arguments

Examples

A few examples of the trackPageView call required on page/state changes can be seen below. The comments denote if the script were to be implemented on www.example.com.

// Would trigger the virtual page URL of www.example.com/About-Us
decibelInsight('trackPageView', '/About-Us');

// Would trigger the virtual page URL of www.example.com/Search?page=1&q=Laptops
decibelInsight('trackPageView', '/Search', {
    queryString: '?page=1&q=Laptops',
    waitTime: 1000
});