LoginSignup
1
0

More than 5 years have passed since last update.

RailsでABテスト

Posted at

Splitを使ってABテストを実装する

redisをインストール
$ brew install redis

Redisサーバを立ち上げる
$ redis-server

bundlerでsplitをインストール
gem 'split', require: 'split/dashboard'
bundle install

立ち上げてないとこんなエラーが出るので注意
Redis::CannotConnectError (Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)):

routes.rbに以下を記述
mount Split::Dashboard, :at => 'split'

こんな感じにviewに入れてやれば読み込む度にtestAまたはtestBが表示される
index.html.erb
<% ab_test('test_name', 'testA', 'testB') do |text| %>
<%= text %>
<% end %>

コンバージョンを計る箇所に以下を記述
<% finished("create_user") %>

localhost:3000/splitでコンバージョンを見ることができる

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0