Add to index.html:
<script>(function(i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r;i[
r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments);}, i[r].l
= 1 * new Date();a = s.createElement(o),m = s.getElementsByTagName(o)[0];
a.async
= 1; a.src = g;m.parentNode.insertBefore(a, m);})(window, document, 'script'
, '//www.google-analytics.com/analytics.js', 'ga');</script>
and in the module.run()
$rootScope.$on('$routeChangeSuccess' function() {
if (typeof(ga) != 'undefined') {
ga('create', gaTrackingCode, 'auto');
ga('set', 'page', $location.path());
ga('send', 'pageview');
}
});
where gaTrackingcode is set in config.js and injected into the run() method.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.