提交 043b1ae0 编写于 作者: G Gabriele Cirulli

add analytics

上级 e65111f1
...@@ -62,5 +62,14 @@ ...@@ -62,5 +62,14 @@
Created by <a href="http://gabrielecirulli.com" target="_blank">Gabriele Cirulli.</a> Based on <a href="https://itunes.apple.com/us/app/1024!/id823499224" target="_blank">1024 by Veewo Studio.</a> Created by <a href="http://gabrielecirulli.com" target="_blank">Gabriele Cirulli.</a> Based on <a href="https://itunes.apple.com/us/app/1024!/id823499224" target="_blank">1024 by Veewo Studio.</a>
</p> </p>
</div> </div>
<script>
(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,"script","//www.google-analytics.com/analytics.js","ga");
ga("create", "UA-42620757-2", "gabrielecirulli.github.io");
ga("send", "pageview");
</script>
</body> </body>
</html> </html>
...@@ -89,4 +89,5 @@ HTMLActuator.prototype.updateScore = function (score) { ...@@ -89,4 +89,5 @@ HTMLActuator.prototype.updateScore = function (score) {
HTMLActuator.prototype.message = function (won) { HTMLActuator.prototype.message = function (won) {
var type = won ? "game-won" : "game-over"; var type = won ? "game-won" : "game-over";
this.gameContainer.classList.add(type); this.gameContainer.classList.add(type);
if (ga) ga("send", "event", "game", "end", type, this.score);
}; };
...@@ -53,7 +53,7 @@ h1.title { ...@@ -53,7 +53,7 @@ h1.title {
position: relative; position: relative;
float: right; float: right;
background: #bbada0; background: #bbada0;
padding: 15px 20px; padding: 15px 25px;
font-size: 25px; font-size: 25px;
height: 25px; height: 25px;
line-height: 47px; line-height: 47px;
......
...@@ -64,7 +64,7 @@ h1.title { ...@@ -64,7 +64,7 @@ h1.title {
position: relative; position: relative;
float: right; float: right;
background: $game-container-background; background: $game-container-background;
padding: 15px 20px; padding: 15px 25px;
font-size: $height; font-size: $height;
height: $height; height: $height;
line-height: $height + 22px; line-height: $height + 22px;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册