Ver código fonte

Merge pull request #265 from hackedd/ga-undefined

Fix "ReferenceError: ga is not defined"
Gaël Métais 7 anos atrás
pai
commit
63c0de42db
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      front/src/js/app.js

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

@@ -35,7 +35,7 @@ yltApp.run(['$rootScope', '$location', function($rootScope, $location) {
 
 
     // Google Analytics
     // Google Analytics
     $rootScope.$on('$routeChangeSuccess', function(){
     $rootScope.$on('$routeChangeSuccess', function(){
-        if (ga) {
+        if (typeof ga !== "undefined") {
             ga('send', 'pageview', {'page': $location.path()});
             ga('send', 'pageview', {'page': $location.path()});
         }
         }
     });
     });