overleaf/services/web/public/coffee/analytics/AnalyticsManager.coffee

17 lines
505 B
CoffeeScript
Raw Normal View History

2014-02-12 10:23:40 +00:00
define () ->
class AnalyticsManager
constructor: (@ide) ->
@ide.editor.on "update:doc", () =>
@updateCount ||= 0
@updateCount++
if @updateCount == 100
ga('send', 'event', 'editor-interaction', 'multi-doc-update')
2014-02-12 10:23:40 +00:00
@ide.pdfManager.on "compile:pdf", () =>
@compileCount ||= 0
@compileCount++
if @compileCount == 1
ga('send', 'event', 'editor-interaction', 'single-compile')
2014-02-12 10:23:40 +00:00
if @compileCount == 3
ga('send', 'event', 'editor-interaction', 'multi-compile')