]> _ Git - fluidbook-html5.git/commitdiff
wip #4046 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 19 Nov 2020 14:17:08 +0000 (15:17 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 19 Nov 2020 14:17:08 +0000 (15:17 +0100)
js/libs/fluidbook/cart/fluidbook.cart.mopec.js
js/libs/fluidbook/fluidbook.accessibility.js
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.stats.js
js/libs/fluidbook/links/fluidbook.links.zoom.js

index c357b9814fed715191d248c2def86c6802a81770..0cb6c6aeae311f2eeef427ac5bc93099eef78424 100644 (file)
@@ -9,6 +9,7 @@ function FluidbookCartMopec(cart) {
     this.handleTaxes = false;
     this.minQuantities = {};
     this.idBySku = {};
+    this.lastRefClicked = '';
 
     this.initBaseURL();
     this.init();
@@ -55,6 +56,17 @@ FluidbookCartMopec.prototype = {
             return true;
         });
 
+        $(document).on('click', '#zoomPopupMenu a.button.ext', function () {
+            var ref = $(this).parent().find('[data-cart-ref]').data('cart-ref');
+            $this.fluidbook.stats._ga('event', 'Fluidbook', 'see_website', ref);
+            return true;
+        });
+
+        $(document).on('click', 'a[href$="customer/account/login/"]', function () {
+            $this.fluidbook.stats._ga('event', 'Fluidbook', 'sign_in', $this.lastRefClicked);
+            return true;
+        })
+
         this.updateCartData(function () {
 
         });
@@ -84,11 +96,13 @@ FluidbookCartMopec.prototype = {
 
     addToCart: function (ref, quantity) {
         var $this = this;
+        this.lastRefClicked = ref;
+        this.fluidbook.stats._ga('event', 'Fluidbook', 'add_to_cart', ref);
         if (!this.checkLoginSession()) {
             return;
         }
         this.fluidbook.displayLoader();
-        this.fluidbook.stats._ga('event', 'Fluidbook', 'add_to_cart', ref);
+
 
         this.getProductIDBySKU(ref, function (product_id) {
             if (product_id === null) {
index 08842c2358da89fe5d76bb23c994cec14dbcb978..9958e3ca895b8a763f2bd06f1beedd92c0b2c7f4 100644 (file)
@@ -20,7 +20,6 @@ FluidbookAccessibility.prototype = {
     },
 
     endChangePage: function (page) {
-        console.log('change page '+page);
         this.audiodescription.setupPages();
         this.updateTexts();
     },
index 588360ff5cbc4ebfcc0c1fd66614cda51a398f20..6fa9a3b7534c3f11bffda83eeb6efb4adb7c97be 100644 (file)
@@ -88,7 +88,6 @@ FluidbookLinks.prototype = {
 
 
         $(document).on('click', 'a, [data-pseudolink-href]', function () {
-            console.log(this);
             if ($(this).is('#wopen')) {
                 return true;
             }
index c7ead089d6ee9c2960cb6255e032e0bbd72886d4..5ee07f53e77da60979fdf109eb78089e4a9c4c66 100644 (file)
@@ -149,6 +149,7 @@ FluidbookStats.prototype = {
     },\r
 \r
     _ga: function (a0, a1, a2, a3, a4) {\r
+        console.log('ga', this.ga, a0, a1, a2, a3, a4);\r
         var args = Array.prototype.slice.call(arguments);\r
         if (this.ga === 'gtag') {\r
             var f, o, c, a;\r
index c75b94ffd996a6888cc8d324d1ea20ba58a7ce75..fa0724accb39daa06e28b941cbb9baed328d5235 100644 (file)
@@ -358,10 +358,12 @@ FluidbookLinksZoom.prototype = {
                     }, 600);
                 }, 50);
 
-                $this.fluidbook.stats.track(2, $this.fluidbook.currentPage);
+
             });
 
         });
+
+        this.fluidbook.stats.track(2, this.fluidbook.currentPage);
     },
 
     getLink: function (url) {