Просмотр исходного кода

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

Sampled Countly tracking
Paulo Jorge Reis 10 лет назад
Родитель
Сommit
e6c501eb16

+ 2 - 2
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")

+ 3 - 0
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", () ->