Browse Source

fix so that google analytics script are cached

Marcus Efraimsson 7 năm trước cách đây
mục cha
commit
ddeba41638
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      public/app/core/services/analytics.ts

+ 5 - 1
public/app/core/services/analytics.ts

@@ -7,7 +7,11 @@ export class Analytics {
   constructor(private $rootScope, private $location) {}
 
   gaInit() {
-    $.getScript('https://www.google-analytics.com/analytics.js'); // jQuery shortcut
+    $.ajax({
+      url: 'https://www.google-analytics.com/analytics.js',
+      dataType: 'script',
+      cache: true,
+    });
     var ga = ((<any>window).ga =
       (<any>window).ga ||
       function() {