Skip to content

Commit

Permalink
Hopefully fixes #29: Improve Google Analytics so it knows what pages …
Browse files Browse the repository at this point in the history
…people are viewing
  • Loading branch information
Shawn Taylor committed Nov 9, 2016
1 parent 101838c commit c193713
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion angular/app/scripts/app.js
Expand Up @@ -21,10 +21,11 @@ angular
'ngTouch',
'ui.bootstrap'
])
.run(['$rootScope', '$route', '$window', function($rootScope, $route, $window) {
.run(['$rootScope', '$route', '$window', '$location', function($rootScope, $route, $window, $location) {
$rootScope.$on('$routeChangeSuccess', function() {
document.title = $route.current.title + "Georgia Early Voting | Code for Atlanta";
$window.scrollTo(0,0);
$window.ga('send', 'pageview', { page: $location.url() }); // allows google analytics to track "pages" within the SPA
});
}])
// .config(function($mdThemingProvider) {
Expand Down

0 comments on commit c193713

Please sign in to comment.