Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add latency to add answer/link track

  • Loading branch information...
commit ec6e02b28e137bbb009de6ea8a6dd6f939a724f8 1 parent 3e25598
Alex Bredariol Grilo authored
View
3  app/controllers/answers_controller.rb
@@ -102,7 +102,8 @@ def create
track_event(:answered_question,
:question_answers_count => @question.search_results.count,
- :own_question => @question.user_id == @answer.user_id)
+ :own_question => @question.user_id == @answer.user_id,
+ :latency => (@answer.created_at - @question.created_at).to_i / 60)
format.html do
flash[:notice] = t(:flash_notice, :scope => "answers.create")
View
3  app/controllers/search_results_controller.rb
@@ -15,7 +15,8 @@ def create
track_event(:commented, :commentable => @search_result.class.name)
end
end
- track_event(:added_link)
+ track_event(:added_link,
+ :latency => (@search_result.created_at - @question.created_at).to_i / 60)
notice_message = t(:flash_notice, :scope => "search_results.create")
format.html do
flash[:notice] = notice_message
Please sign in to comment.
Something went wrong with that request. Please try again.