add advanced tracking

This commit is contained in:
Bruno Rybársky 2023-04-01 19:34:07 +02:00
parent 82db1a9753
commit c997e6581e
No known key found for this signature in database
GPG Key ID: DFE2C061EF985CD4
3 changed files with 15 additions and 3 deletions

@ -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");
}

@ -3,9 +3,9 @@
<head>
<title>WAAAAAA</title>
<link rel="stylesheet" href="index.css" type="text/css"/>
<script async defer data-website-id="11366cfe-e3d4-4b98-a19f-7ed471a37f71" src="https://umami.brn.systems/umami.js"></script>
<script src="jquery.min.js"></script>
<script src="index.js"></script>
<script async defer data-website-id="11366cfe-e3d4-4b98-a19f-7ed471a37f71" src="https://umami.brn.systems/umami.js"></script>
</head>
<body>
<div id="imagecontainer" class="itemcont">

@ -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' });
}