Created
October 28, 2014 09:25
-
-
Save Grom-S/5f2f9458c3f7e30cbaa0 to your computer and use it in GitHub Desktop.
Google analytics in Angular SPA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('main').run(function ($rootScope, $location, $window) { | |
$rootScope.$on('$routeChangeSuccess', function () { | |
var path = $location.path(); | |
$window.ga('send', 'pageview', {page: path}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment