Skip to content

Commit

Permalink
added google analytics events
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-adriansens authored Nov 22, 2023
1 parent fe4867a commit 23dd835
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ window.onload = () => {
soundtrack.currentTime = 0;
soundtrack.play();

// alpinaWebAnalytics.emit("newGame");
gtag("event", "new_game", {
category: "game_event",
discription: "New game started!",
});
});

usernameHTML.addEventListener("input", () => {
Expand Down Expand Up @@ -184,7 +187,10 @@ function new_score(newScore, final = false) {
window.localStorage.setItem("scores", scores);

local_scores();
// alpinaWebAnalytics.emit("newScore");
gtag("event", "game_end", {
category: "game_event",
discription: "Game ended and score uploaded!",
});
}

function upload_highscore(score) {
Expand Down

0 comments on commit 23dd835

Please sign in to comment.