diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 415d2f6aad..21ec07f7b8 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -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") diff --git a/services/web/public/coffee/main/event.coffee b/services/web/public/coffee/main/event.coffee index 58e43f3b9f..68decfd5ee 100644 --- a/services/web/public/coffee/main/event.coffee +++ b/services/web/public/coffee/main/event.coffee @@ -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", () ->