From: Vincent Vanwaelscappel Date: Wed, 21 Sep 2022 14:52:00 +0000 (+0200) Subject: wait #5473 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=22bb3c72285995aeb7a0c22d93af81cb5d39d78d;p=fluidbook-html5.git wait #5473 @3 --- diff --git a/js/libs/fluidbook/fluidbook.stats.js b/js/libs/fluidbook/fluidbook.stats.js index 4cccbf0c..a6867d0a 100644 --- a/js/libs/fluidbook/fluidbook.stats.js +++ b/js/libs/fluidbook/fluidbook.stats.js @@ -162,7 +162,7 @@ FluidbookStats.prototype = { try { this.trackGoogleAnalytics(type, page, extra); } catch (e) { - + console.log(e); } }, @@ -304,6 +304,7 @@ FluidbookStats.prototype = { }, _ga: function (a0, a1, a2, a3, a4) { + console.log('_ga', a0, a1, a2, a3, a4); var args = Array.prototype.slice.call(arguments); if (this.ga === 'gtm') { var dl = {}; @@ -319,32 +320,26 @@ FluidbookStats.prototype = { } dataLayer.push(dl); } else if (this.ga === 'gtag') { - var f, o, c, a; + var f, o, a; o = {}; if (a0 === 'pageview') { - f = 'config'; - c = true; + f = 'event'; o = {}; + a = 'page_view'; if (a1 !== undefined) { o.page_path = a1; } } else if (a0 === 'event') { f = 'event'; - c = false; a = a2; o.event_category = a1; o.event_label = a3; } - if (c) { - $.each(this.gaCodes, function (k, code) { - gtag(f, code, o); - }); - } else { - if (this.ga === 'gtag') { - gtag(f, a, o); - } - } + $.each(this.gaCodes, function (k, code) { + var data = $.extend({send_to: code}, o) + gtag(f, a, data); + }); } else if (this.ga === 'ga') { $.each(ga.getAll(), function (k, tracker) { try {