Explorar o código

Fix google analytics trying to send events

Gaël Métais %!s(int64=7) %!d(string=hai) anos
pai
achega
61bd31e421
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      front/src/js/app.js

+ 3 - 1
front/src/js/app.js

@@ -35,7 +35,9 @@ yltApp.run(['$rootScope', '$location', function($rootScope, $location) {
 
 
     // Google Analytics
     // Google Analytics
     $rootScope.$on('$routeChangeSuccess', function(){
     $rootScope.$on('$routeChangeSuccess', function(){
-        ga('send', 'pageview', {'page': $location.path()});
+        if (ga) {
+            ga('send', 'pageview', {'page': $location.path()});
+        }
     });
     });
 
 
     // GitHub star button (asynchronously loaded iframe)
     // GitHub star button (asynchronously loaded iframe)