O'Reilly logo

AngularJS Deployment Essentials by Zachariah Moreno

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding support to Google Analytics

Adding Google Analytics to a web application is typically a straightforward process. However, when you make the jump to a Single Page Application (SPA) framework, such as AngularJS, things get a little more complicated for Google Analytics. Because of Angular's ng-view directive (within your index.html) injecting content upon route changes, the tracking necessary for Google Analytics does not get updated upon such events. Luckily, Angular's community has stepped up to this challenge and produced a third-party module called angular-google-analytics that resolves the challenges faced in this endeavor. The angular-google-analytics module resolves our worries by providing a service that sends a new pageview event ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required