Track log hints feedback.

This commit is contained in:
Paulo Reis 2016-06-30 11:30:30 +01:00
parent 05dedeebb8
commit c5f53ef431
2 changed files with 9 additions and 2 deletions

View file

@ -128,12 +128,12 @@ div.full-size.pdf(ng-controller="PdfController")
)
label.card-hint-feedback-label #{translate("log_hint_feedback_label")}
a.card-hint-feedback-positive(
ng-click="feedbackSent = true;"
ng-click="trackLogHintsPositiveFeedback(entry.ruleId); feedbackSent = true;"
href
) #{translate("answer_yes")}
span  / 
a.card-hint-feedback-negative(
ng-click="feedbackSent = true;"
ng-click="trackLogHintsNegativeFeedback(entry.ruleId); feedbackSent = true;"
href
) #{translate("answer_no")}
.card-hint-feedback(ng-show="feedbackSent")

View file

@ -15,6 +15,13 @@ define [
$scope.shouldShowLogs = false
$scope.wikiEnabled = window.wikiEnabled;
# log hints tracking
trackLogHintsFeedback = (isPositive, hintId) ->
event_tracking.send 'log-hints', (if isPositive then 'feedback-positive' else 'feedback-negative'), hintId
$scope.trackLogHintsPositiveFeedback = (hintId) -> trackLogHintsFeedback true, hintId
$scope.trackLogHintsNegativeFeedback = (hintId) -> trackLogHintsFeedback false, hintId
if ace.require("ace/lib/useragent").isMac
$scope.modifierKey = "Cmd"
else