diff --git a/js/html_actuator.js b/js/html_actuator.js index c697dabcb2abd0be5ee02a7e22c48b69f8497ad0..189208732df26b134f69359e2dec87cf2c1029e8 100644 --- a/js/html_actuator.js +++ b/js/html_actuator.js @@ -117,6 +117,10 @@ 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); + } + this.messageContainer.classList.add(type); this.messageContainer.getElementsByTagName("p")[0].textContent = message;