]> _ Git - fluidbook-html5.git/commitdiff
wait #6895 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 6 May 2024 16:41:44 +0000 (18:41 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 6 May 2024 16:41:44 +0000 (18:41 +0200)
js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js
js/libs/fluidbook/fluidbook.stats.js

index 3f26676647f223daba1c38ce156bc3809f886ca7..7972062c599f5173a09ae171e9a5c9273fa4e4b2 100644 (file)
@@ -31,9 +31,11 @@ FluidbookCartBastideResah.prototype = {
         $(document).on(this.fluidbook.input.clickEvent, '#Bastide_cart [data-validate-cart]', function (event) {
             event.preventDefault();
 
-            $.ajax('https://bastide-resah.fluidbook.com/fluidbook/order', {
+            $.ajax('/fluidbook/order', {
                 method: 'POST',
                 data: {details: $this.getItems()},
+            }).done(function (data) {
+                $this.fluidbook.stats.trackEcommerceOrder([data.order, data.total]);
             });
 
             $this.fluidbook.menu.quickCloseView();
index 25e407fd0a4b45f93b738873b0335dba45f780c4..a9bdfa37eb9c2645668c9942e9e6ed4aa7adb72b 100644 (file)
@@ -148,6 +148,7 @@ FluidbookStats.prototype = {
                 break;
             case 15://
                 this.matomoPush(['trackEvent', 'cart', 'addproduct', extra]);
+                this.matomoPush(['setEcommerceView', extra]);
         }
     },
 
@@ -457,6 +458,9 @@ FluidbookStats.prototype = {
         }
     },
 
+    trackEcommerceOrder: function (orderId, total) {
+        this.matomoPush(['trackEcommerceOrder', orderId, total]);
+    },
 
     trackGoogleAnalytics: function (type, page, extra, url) {
         this.checkGoogleAnalytics();