Permalink
Browse files

Really don't track unlogged users on some experiments.

  • Loading branch information...
1 parent 1cda198 commit 6b452b233b3fa41165e80a63cc80a6364dfd7ab5 @mpereira mpereira committed Nov 9, 2011
@@ -40,9 +40,14 @@ def _vanity_identity
# This identifier recognizes untracked users' identities via cookies even if
# they're not logged in. It's used in our vanity experiment files.
- def identify_vanity
+ #
+ # Options:
+ # exclude_guests: don't track non-logged visitors _at all_.
+ def identify_vanity(options = {})
if identity = _vanity_identity
identity.id
+ elsif options[:exclude_guests]
+ Umamao::UntrackedUser.instance.id
else
set_vanity_cookie(SecureRandom.hex(16)) unless cookies[:vanity_id]
cookies[:vanity_id]
@@ -1,5 +1,5 @@
ab_test 'Answer with form position' do
alternatives :below, :above
metrics :new_search_result
- identify { |c| c.identify_vanity }
+ identify { |c| c.identify_vanity(:exclude_guests => true) }
end
@@ -1,5 +1,5 @@
ab_test 'New question as search' do
alternatives :old_search_scheme, :new_search_scheme
metrics :asked_question
- identify { |c| c.identify_vanity }
+ identify { |c| c.identify_vanity(:exclude_guests => true) }
end
@@ -1,5 +1,5 @@
ab_test 'News item search results helpers' do
alternatives :answer, :search_results
metrics :search_results_news_items
- identify { |c| c.identify_vanity }
+ identify { |c| c.identify_vanity(:exclude_guests => true) }
end

1 comment on commit 6b452b2

👍

Please sign in to comment.