]> _ Git - fluidbook-html5.git/commitdiff
wip #3675 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 2 Jun 2020 12:51:33 +0000 (14:51 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 2 Jun 2020 12:51:33 +0000 (14:51 +0200)
js/libs/fluidbook/fluidbook.stats.js

index b729848ae72a7f9ea7b21f1128361e974237986a..fcb9ed714ea1858a6c9f56cebb6121e37ca99612 100644 (file)
@@ -8,6 +8,7 @@ function FluidbookStats(fluidbook) {
     if (this.fluidbook.settings.googleAnalytics !== '') {\r
         this.ga = 'gtag';\r
         this.gaCodes = this.fluidbook.settings.googleAnalytics.split(',');\r
+        gtag('js', new Date());\r
         $.each(this.gaCodes, function (k, code) {\r
             gtag('config', code, {'send_page_view': false});\r
         });\r
@@ -47,6 +48,8 @@ FluidbookStats.prototype = {
             return;\r
         }\r
 \r
+        console.log('trackGoogleAnalytics',type,page,extra);\r
+\r
         var url = location.pathname + location.search + location.hash\r
 \r
         switch (type) {\r
@@ -102,7 +105,7 @@ FluidbookStats.prototype = {
 \r
     _ga: function (a0, a1, a2, a3, a4) {\r
         var args = Array.prototype.slice.call(arguments);\r
-        if (this.ga == 'gtag') {\r
+        if (this.ga === 'gtag') {\r
             var f, o, c, a;\r
             o = {};\r
             if (a0 === 'pageview') {\r
@@ -127,7 +130,7 @@ FluidbookStats.prototype = {
             } else {\r
                 gtag(f, a, o);\r
             }\r
-        } else if (this.ga == 'ga') {\r
+        } else if (this.ga === 'ga') {\r
             args.unshift('send');\r
             window['ga'].apply(null, args);\r
         }\r