Skip to content

Commit

Permalink
adding google analytics to route changes
Browse files Browse the repository at this point in the history
  • Loading branch information
julien51 committed Jun 25, 2013
1 parent c4cd091 commit 1526386
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/subtome.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ subtome.config(['$routeProvider', function($routeProvider) {
}
]);

subtome.run(['$rootScope', function($rootScope) {
subtome.run(['$rootScope', '$location', '$window', function($rootScope, $location, $window) {
$rootScope.$on('$routeChangeSuccess', function() {
$window._gaq.push(['_trackPageview', $location.path()]);
})
$rootScope.loadGists = function loadGists() {
$('.script').each(function(i,div) {
$.ajax({
Expand Down

0 comments on commit 1526386

Please sign in to comment.