diff --git a/cache.appcache b/cache.appcache index 7194fdcd49720d69adef845906b699bfe478c617..cee9dad2de011cd24b4713892f237a67348ca53d 100644 --- a/cache.appcache +++ b/cache.appcache @@ -3,7 +3,7 @@ CACHE MANIFEST # Adds the ability to play the game offline. # The following comment needs to be updated whenever a change is made. # Run `rake appcache:update` to do so -# Updated: 2018-10-27T21:30:00+02:00 +# Updated: 2018-11-04T11:11:51+01:00 # Main page index.html diff --git a/index.html b/index.html index 1e56cc70cc98e89220da7b6b29f481209af1e744..07ce42c6e9a7bce68ff7c22e323e38fa2ac1c03b 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,15 @@ 2048 + + + @@ -171,15 +180,5 @@ - - diff --git a/js/application.js b/js/application.js index 9e9e195e5095f41525ef48be9d831e6d76e4ef76..9b52c57d568c78d4c8d072645ae9ede473f362d1 100644 --- a/js/application.js +++ b/js/application.js @@ -12,7 +12,11 @@ window.requestAnimationFrame(function () { noticeClose.addEventListener("click", function () { notice.parentNode.removeChild(notice); storage.setNoticeClosed(true); - ga("send", "event", "notice", "closed"); + if (typeof gtag !== undefined){ + gtag("event", "closed", { + event_category: "notice", + }); + } }); } }); diff --git a/js/html_actuator.js b/js/html_actuator.js index a37b8fe90c96eaedf14672b9a3a4c6db41d0ca03..b16285098dad403486d709deeb95b72206b7e728 100644 --- a/js/html_actuator.js +++ b/js/html_actuator.js @@ -38,8 +38,10 @@ HTMLActuator.prototype.actuate = function (grid, metadata) { // Continues the game (both restart and keep playing) HTMLActuator.prototype.continueGame = function () { - if (typeof ga !== "undefined") { - ga("send", "event", "game", "restart"); + if (typeof gtag !== "undefined") { + gtag("event", "restart", { + event_category: "game", + }); } this.clearMessage(); @@ -133,8 +135,12 @@ HTMLActuator.prototype.message = function (won) { var type = won ? "game-won" : "game-over"; var message = won ? "You win!" : "Game over!"; - if (typeof ga !== "undefined") { - ga("send", "event", "game", "end", type, this.score); + if (typeof gtag !== "undefined") { + gtag("event", "end", { + event_category: "game", + event_label: type, + value: this.score, + }); } this.messageContainer.classList.add(type); diff --git a/privacy.html b/privacy.html index 4c3f094cce9266a05fa3313a4ab60dd87d92133b..325aa32ca138d74fccb5753ba058066e9267e94b 100644 --- a/privacy.html +++ b/privacy.html @@ -5,6 +5,15 @@ Privacy Policy — 2048 + + + @@ -102,18 +111,6 @@ me@gabrielecirulli.com

- - \ No newline at end of file