From bca3c65eadddc7d62b7b362b82a35ce327e8ee0d Mon Sep 17 00:00:00 2001 From: Yarne Coppens Date: Fri, 4 Oct 2024 09:29:12 +0200 Subject: [PATCH] Placed umami tracking in JS --- static/scripts/main.js | 4 ++++ templates/index.jinja | 14 +++++++------- templates/paycard.jinja | 6 +++--- templates/paycash.jinja | 6 +++--- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/static/scripts/main.js b/static/scripts/main.js index d077d27..4eb8ea5 100644 --- a/static/scripts/main.js +++ b/static/scripts/main.js @@ -103,6 +103,7 @@ async function loadProducts() { } function removeProduct(element_to_remove){ + umami.track('Remove Product'); const product_row = document.getElementById('product_row') const products = product_row.children @@ -143,15 +144,18 @@ function removeProduct(element_to_remove){ } function payCash() { + umami.track('Pay Cash button'); const total_cost = document.getElementById('totalprice').innerHTML.replace('€ ','') window.location.href = "/pay_cash/" + total_cost } function payCard() { + umami.track('Pay Card button'); const total_cost = document.getElementById('totalprice').innerHTML.replace('€ ','') window.location.href = "/pay_card/" + total_cost } function toMain() { + umami.track('To Main button'); window.location.href = "/"; } \ No newline at end of file diff --git a/templates/index.jinja b/templates/index.jinja index a487e14..31067d2 100644 --- a/templates/index.jinja +++ b/templates/index.jinja @@ -25,7 +25,7 @@
- +
@@ -33,7 +33,7 @@
- +
@@ -41,7 +41,7 @@
- +
@@ -49,7 +49,7 @@
- +
@@ -57,7 +57,7 @@
- +
@@ -81,12 +81,12 @@
- +
- +
diff --git a/templates/paycard.jinja b/templates/paycard.jinja index d9c12ef..d891801 100644 --- a/templates/paycard.jinja +++ b/templates/paycard.jinja @@ -17,7 +17,7 @@
- +
@@ -36,7 +36,7 @@
- +
@@ -51,7 +51,7 @@
- +
diff --git a/templates/paycash.jinja b/templates/paycash.jinja index fda8431..1bed790 100644 --- a/templates/paycash.jinja +++ b/templates/paycash.jinja @@ -17,7 +17,7 @@
- +
@@ -36,7 +36,7 @@
- +
@@ -47,7 +47,7 @@
- +