AngularJS & ui-router module & Google Analytics

Some header here

Some footer there

This example listens to clicks on the navigation and triggers the virtual page views. We do not need controllers, in this case, like in my two previous demos except for the HTML fragment that loads as the first fragment. The master page will trigger a page view tracking request and each HTML fragment will only trigger a page view when the navigation link was clicked on.

Here I have used Google Analytics, AngularJS 1.2.13 and the ui-router 0.2.8 module. Check out the same example using the ngRoute module instead. You can also check out my demo using the same AngularJS and ui-router versions but leveraging the controllers instead here.