looking to stackoverflow post about tracking by google analytics an angular web app (Tracking Google Analytics Page Views with Angular.js) I put in place the code below.
It seems to work well, the callback function gets invoked... but looking to GA web site no tracking data are available.
Do you see anything wrong with this code?
/*tracking in localhost*/
window.ga('create', 'MY_WEB_SITE_ID_HERE', {
cookieDomain: 'none'
});
//to every route change, requests a track to google
$rootScope.$on('$routeChangeSuccess', function(e, current, pre) {
window.ga('send', 'pageview',
{
page: $location.path(),
hitCallback: function() {
alert('analytics.js done sending data');
}
});
});
Code runs during module.run().
Thanks a-lot for help.