mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
16 lines
603 B
CoffeeScript
16 lines
603 B
CoffeeScript
define () ->
|
|
class AnalyticsManager
|
|
constructor: (@ide) ->
|
|
@ide.editor.on "update:doc", () =>
|
|
@updateCount ||= 0
|
|
@updateCount++
|
|
if @updateCount == 100
|
|
mixpanel?.track("Updated doc multiple times in one session", project_id: @ide.project.id)
|
|
|
|
@ide.pdfManager.on "compile:pdf", () =>
|
|
@compileCount ||= 0
|
|
@compileCount++
|
|
if @compileCount == 1
|
|
mixpanel?.track("Compiled project at least once in one session", project_id: @ide.project.id)
|
|
if @compileCount == 3
|
|
mixpanel?.track("Compiled project multiple times in one session", project_id: @ide.project.id)
|