
let ga = window.ga || function(...args) { console.log('[log]', ...args) }

function getLabel(chart) {
  return `${chart.md5} ${[chart.info.title, ...chart.info.subtitles].join(' ')}`
}

export function gameStart(song, chart) {
  ga('send', 'song', 'play', song.title)
  ga('send', 'game', 'start', getLabel(chart), chart.info.level)
}

export function gameFinish(song, chart, gameState) {
  let state = gameState.player(gameState.game.players[0])
  ga('send', 'song', 'finish', song.title)
  ga('send', 'game', 'finish', getLabel(chart), state.stats.score)
}

@@ -225,32 +225,41 @@
 ) %7B%0A  ga('send',
+ 'event',
  'song', 'play',
@@ -275,32 +275,41 @@
 le)%0A  ga('send',
+ 'event',
  'game', 'start'
@@ -471,16 +471,25 @@
 ('send',
+ 'event',
  'song',
@@ -523,16 +523,25 @@
 ('send',
+ 'event',
  'game',

fix ga