Skip to content

Instantly share code, notes, and snippets.

@kevn
Created January 17, 2011 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevn/783347 to your computer and use it in GitHub Desktop.
Save kevn/783347 to your computer and use it in GitHub Desktop.
Experiment DSL
# Simple a/b test
experiment :signup_start_right_now do |exp|
exp.description 'Show a 5th signup step'
exp.ends_at '1 Jul 2011 00:00:00'
exp.control '50%', :with => 'show start step', :returning => false
exp.treat '50%', :with => 'do not show start step', :returning => true
end
# Simple a/b test, different syntax
experiment :signup_start_right_now do |exp|
exp.description 'Show a 5th signup step'
exp.ends_at '1 Jul 2011 00:00:00'
exp.control('50%').with('show start step').returning(false)
exp.treat('50%').with('do not show start step').returning(true)
end
# Simple a/b/c test
experiment :left_nav_wording do |exp|
exp.description 'Try differeny copy on left nav'
exp.ends_at '1 Jul 2011 00:00:00'
exp.control '50%', :with => 'Buy it now', :returning => false
exp.treat '25%', :with => 'Do not miss a moment', :returning => true
exp.treat '25%', :with => 'Your mom wants you to purchase', :returning => true
end
# Shortcut to create a 2-alternative experiment with false(control) at 100% and 0% true
# specify :at => PERCENTAGE to initialize the true group to a value other than 0
rollout :use_new_search, :at => '1%' do |r|
r.description 'use new search technology that is awesome'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment