-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
64 lines (46 loc) · 1.5 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
SevenMinuteAbs
=======
Ab testing is 7 minutes. Not 6, not 5, 7!
Tested in rails 2.3.2
Installation
=======
go to your rails app directory
./script/plugin install git://github.com/paulmars/seven_minute_abs.git
Setup the database to store your info
=======
ruby script/generate ab_migration
rake db:migrate
Include Code
=======
add these lines to these files
module ApplicationHelper
include AbViewHelper
end
class ApplicationController < ActionController::Base
include SevenMinuteAbs
before_filter :ab_click_count
end
Use it!
=======
Test if orange or blue gets more clicks
"linkcolor" -> name of your test
2 -> number of different versions you have (else statement)
make sure to include 'test.stub' in any urls, otherwise clicks won't be counted!
<% ab_test("linkcolor", 2) do |test,version|%>
<% if version == 0 %>
<%= link_to "Blue version", url_for(:ab => test.stub), {:style => "color:blue"} %>
<% elsif version == 1 %>
<%= link_to "Orange version", url_for(:ab => test.stub), {:style => "color:orange"} %>
<% end %>
<% end %>
See Stats
=======
A quick way to see your stats. You want the highest % possible to be your main choice!
<% Ab.find(:all).each do |ab| %>
<div class="ab-result">
<pre>
name:<%= ab.testname %> v:<%= ab.version %> <%= ab.percent_clicked %>% <%= ab.display_count %> <%= ab.click_count %> <%= ab.stub %> <%= ab.created_at %>
</pre>
</div>
<% end %>
Copyright (c) 2009 Paul McKellar, released under the MIT license