Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't track visitors on these two experiments.

  • Loading branch information...
commit 57ea4c023fc3eb98d23627b90b26a3b5f26b50d2 1 parent 2568e78
@mpereira mpereira authored
View
12 app/controllers/application_controller.rb
@@ -1,7 +1,6 @@
# -*- coding: undecided -*-
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
-require 'singleton'
class ApplicationController < ActionController::Base
include AuthenticatedSystem
@@ -19,15 +18,6 @@ class ApplicationController < ActionController::Base
before_filter :track_user
layout :set_layout
- # Vanity expects an object that responds to #id.
- class UntrackedUser
- include Singleton
-
- def id
- '03571a60f217cf68f795875d108a73fa21e0c2bcce7f'
- end
- end
-
# This is a turnaround for the shortcomings of the vanity gem. This code will
# create at most one participant and one conversion in a random group for all
# our untracked users. This is necessary because `use_vanity` is a class-level
@@ -36,7 +26,7 @@ def id
def _vanity_identity
if current_user
- current_user.tracked? ? current_user : UntrackedUser.instance
+ current_user.tracked? ? current_user : Umamao::UntrackedUser.instance
end
end
View
2  experiments/answer_with_form_position.rb
@@ -1,4 +1,6 @@
ab_test 'Answer with form position' do
alternatives :below, :above
metrics :new_search_result
+ identify { |c| c.current_user ? c.current_user.id :
+ Umamao::UntrackedUser.instance.id }
end
View
2  experiments/question_responding_helpers.rb
@@ -1,4 +1,6 @@
ab_test 'Question responding helpers' do
alternatives :none, :google_search_link, :bing_results
metrics :question_posted
+ identify { |c| c.current_user ? c.current_user.id :
+ Umamao::UntrackedUser.instance.id }
end
View
3  lib/umamao.rb
@@ -0,0 +1,3 @@
+module Umamao; end
+
+require File.expand_path('../umamao/untracked_user', __FILE__)
View
10 lib/umamao/untracked_user.rb
@@ -0,0 +1,10 @@
+require 'singleton'
+
+# Vanity expects an object that responds to #id.
+class Umamao::UntrackedUser
+ include Singleton
+
+ def id
+ '03571a60f217cf68f795875d108a73fa21e0c2bcce7f'
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.