From c997e6581e8bd91a79add8f93ee2beebecbd3fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sat, 1 Apr 2023 19:34:07 +0200 Subject: [PATCH] add advanced tracking --- index.css | 6 +++++- index.html | 2 +- index.js | 10 +++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/index.css b/index.css index ddd4ec9..0249509 100644 --- a/index.css +++ b/index.css @@ -1,3 +1,7 @@ +*{ + background-color: darkgray; +} + #activeholder{ position: absolute; width: 100%; @@ -26,7 +30,7 @@ #trashcan{ width: 32px; height: 32px; - background-color:darksalmon; + background-color:red; background-image: url("assets/trashcan.png"); } diff --git a/index.html b/index.html index be681d4..947f85f 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,9 @@ WAAAAAA + -
diff --git a/index.js b/index.js index 2d34359..4d20b09 100644 --- a/index.js +++ b/index.js @@ -101,8 +101,12 @@ function checkAnswers() { if (vzorcodes == imagecodes && vzorcodes == lettercodes){ cleanup(); generatePair(); + umami.trackEvent('Successful round', { type: 'successround' }); } - console.log("Vzor:" + vzorcodes + "\nLettercodes:" + lettercodes + "\nImagecodes:" + imagecodes); + else{ + umami.trackEvent('Unsuccessful round', { type: 'failround' }); + } + umami.trackEvent("Round data", { type: 'rounddata', Vzor: vzorcodes, Lettercodes: lettercodes, Imagecodes: imagecodes }); } function getRandomInt(min, max) { @@ -283,6 +287,7 @@ $(function() { $("#verify").on("click", checkAnswers); $("#trashcan").on("click", cleanup); + umami.trackEvent('Page loaded', { type: 'load' }); }); @@ -300,6 +305,7 @@ function drag(ev) { ev.dataTransfer.setData("classy", ev.target.classList); let datacode = $(ev.target).attr("datacode"); document.getElementById("audplay"+ datacode).play(); + umami.trackEvent('Dragged object', { type: 'dragged' }); } function drop(ev) { @@ -328,6 +334,7 @@ function drop(ev) { let returnto = ev.dataTransfer.getData("returnto"); //$('[returntarget="' + returnto + '"]').html(htmldata); } + umami.trackEvent('Dropped object', { type: 'dropped' }); } function droptrash(ev) { @@ -337,5 +344,6 @@ function droptrash(ev) { let htmldata = ev.dataTransfer.getData("text"); let returnto = ev.dataTransfer.getData("returnto"); $('[returntarget="' + returnto + '"]').html(htmldata); + umami.trackEvent('Dragged object into trashcan', { type: 'droptrash' }); }