diff --git a/js/html_actuator.js b/js/html_actuator.js index b6aec4015e50f9aae506b554edaf6a890baed67c..3e51195440a6eea9493526e98db005c8948b6c3f 100644 --- a/js/html_actuator.js +++ b/js/html_actuator.js @@ -118,9 +118,11 @@ HTMLActuator.prototype.updateBestScore = function (bestScore) { HTMLActuator.prototype.message = function (won) { var type = won ? "game-won" : "game-over"; - var message = won ? "You win!" : "Game over!" + var message = won ? "You win!" : "Game over!"; - if (ga) ga("send", "event", "game", "end", type, this.score); + if (typeof ga !== "undefined") { + ga("send", "event", "game", "end", type, this.score); + } this.messageContainer.classList.add(type); this.messageContainer.getElementsByTagName("p")[0].textContent = message;