فهرست منبع

Fix "ReferenceError: ga is not defined"

Paul Hooijenga 7 سال پیش
والد
کامیت
5646a22245
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  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()});
         }
         }
     });
     });