]> _ Git - fluidbook-html5.git/commitdiff
wait #5473 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 21 Sep 2022 14:52:00 +0000 (16:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 21 Sep 2022 14:52:04 +0000 (16:52 +0200)
js/libs/fluidbook/fluidbook.stats.js

index 4cccbf0c6b98ca0236712e42fa9bc8f8d77bb021..a6867d0aba4c31bcd4a33783d5c208ff550df900 100644 (file)
@@ -162,7 +162,7 @@ FluidbookStats.prototype = {
         try {\r
             this.trackGoogleAnalytics(type, page, extra);\r
         } catch (e) {\r
-\r
+            console.log(e);\r
         }\r
     },\r
 \r
@@ -304,6 +304,7 @@ FluidbookStats.prototype = {
     },\r
 \r
     _ga: function (a0, a1, a2, a3, a4) {\r
+        console.log('_ga', a0, a1, a2, a3, a4);\r
         var args = Array.prototype.slice.call(arguments);\r
         if (this.ga === 'gtm') {\r
             var dl = {};\r
@@ -319,32 +320,26 @@ FluidbookStats.prototype = {
             }\r
             dataLayer.push(dl);\r
         } else if (this.ga === 'gtag') {\r
-            var f, o, c, a;\r
+            var f, o, a;\r
             o = {};\r
             if (a0 === 'pageview') {\r
-                f = 'config';\r
-                c = true;\r
+                f = 'event';\r
                 o = {};\r
+                a = 'page_view';\r
                 if (a1 !== undefined) {\r
                     o.page_path = a1;\r
                 }\r
             } else if (a0 === 'event') {\r
                 f = 'event';\r
-                c = false;\r
                 a = a2;\r
                 o.event_category = a1;\r
                 o.event_label = a3;\r
             }\r
 \r
-            if (c) {\r
-                $.each(this.gaCodes, function (k, code) {\r
-                    gtag(f, code, o);\r
-                });\r
-            } else {\r
-                if (this.ga === 'gtag') {\r
-                    gtag(f, a, o);\r
-                }\r
-            }\r
+            $.each(this.gaCodes, function (k, code) {\r
+                var data = $.extend({send_to: code}, o)\r
+                gtag(f, a, data);\r
+            });\r
         } else if (this.ga === 'ga') {\r
             $.each(ga.getAll(), function (k, tracker) {\r
                 try {\r