Merge pull request #274 from sharelatex/pr-countly-sampled

Sampled Countly tracking
This commit is contained in:
Paulo Jorge Reis
2016-07-08 10:53:37 +01:00
committed by GitHub
2 changed files with 5 additions and 2 deletions
@@ -267,10 +267,10 @@ define [
return path
$scope.recompile = (options = {}) ->
event_tracking.sendCountly "editor-recompile", options
return if $scope.pdf.compiling
event_tracking.sendCountlySampled "editor-recompile", options
$scope.pdf.compiling = true
ide.$scope.$broadcast("flush-changes")
@@ -11,6 +11,9 @@ define [
eventData = { key }
eventData.segmentation = segmentation if segmentation?
Countly?.q.push([ "add_event", eventData ]);
sendCountlySampled: (key, segmentation) ->
@sendCountly key, segmentation if Math.random() < .01
}
# App.directive "countlyTrack", () ->