Wednesday, February 29, 2012

Rails A/B testing with Split on Heroku

I recently decided to start doing some A/B testing on www.checkthesock.com. The last time I tried A/B testing I used Google website optimizer, it worked fairly well but I did not like how difficult it was to setup a test. This time I looked around for A/B testing tools for rails. I ended up finding split and so far I have been very happy with the results. The documentation is fairly good but it did take a little fiddling to get it working on Heroku.

First off add the Redis to Go add-on in Heroku, the Nano plan is free and has been sufficient for my needs so far. Install redis on the dev server. I use a mac so that was as simple as "brew install redis" and then I followed the brew instructions for getting redis to start on login.

To install the split gem add the following to the Gemfile

 gem 'split', '0.3.3', :require => 'split/dashboard'

To set the development environment up in a way that is compatible to how Redis to Go is configured on Heroku add the following to config/environments/development.rb

ENV['REDISTOGO_URL'] = 'redis://localhost:6379'
Then create an initializer for redis in config/initializers/redis.rb and put the following in that file.
uri = URI.parse(ENV['REDISTOGO_URL'])
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password, :username => uri.user)
To configure split to use the applications redis configuration create config/initializers/split.rb and add the following.
Split.redis = REDIS

To setup the split dashboard add the following to config/routes.rb

mount Split::Dashboard, :at => 'split'
To add authentication to the dashboard add the following to config/initializers/split.rb
Split::Dashboard.use Rack::Auth::Basic do |username, password|
  username == 'username' && password == 'password'
end

Setting up an A/B test is super easy just follow the instructions in the split README.

Resources:

Note: These instructions are for rails 3.x, the listed resources do have instructions for earlier versions of rails.

30 comments:

Joel Kemp said...

Thanks for this! Very clean and concise.

Unknown said...

Thanks, always nice to hear when someone thinks one of my posts was useful.

Unknown said...

Nathan, thanks for your helpful post. One quick question, I hope you know the answer to: I noticed the css styling of the Split dashboard page is gone on Heroku. Have you encountered the same problem and if so, have you solved it?

Thanks, Pascal

Pierre Olivier Martel said...

Pascal, I think it has to do with the way Heroku compiles the assets on the Cedar stack. I tried to find a fix but finally resolved to copying the Split assets to the Public folder. Far from ideal but it works...

Phil Whelan said...

Hi Nathan,

Great post! I'm working on building a similar service, so woud be great to get your feedback and pick your brains. More info here http://www.fluidfeatures.com/

Cheers,
Phil

Aadita kumar said...


Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..

Android Training in Chennai

Jeffy said...


Thank you for sharing such a nice and interesting blog with us. Hope it might be much useful for us. keep on updating...!!
seo company in india
digital marketing company in india
seo company in chennai
digital marketing company in chennai

Ven hudson said...

Thanks for sharing the article. I would like to recommend that users should also try A/B testing Tool by MockingFish. It' a good tool and really helpful for all those who are searching for a good tools for there website.

for ict 99 said...

I have read your blog its very attractive and impressive. I like it your blog.

Digital Marketing Company in Chennai Digital Marketing Agency

SEO Company in India SEO Services in India

Digital Marketing Company in Chennai

smarther3 said...

This blog explains the details about changing the ways of doing that business. That is understand well and doing some different process. Provides he best output of others. Thanks for this blog.

Mobile App Development Company in India

reginald surict said...

Hey, I encourage you to read the following post to know how to catch a cheater.

ASO Services said...

Thanks a lot for sharing this with all of us, I like it and we can communicate. Do you need buy app ratings and reviews. To boost app ranking and double app downloads now.

Lauren Gottlieb said...

Thank you for such a well written article. It’s full of insightful information and entertaining descriptions. Your point of view is the best among many. seo services kc

hotmail said...

hotmail.com email login inbox. For detail instructions– How to Create New Hotmail Account. Go to the official website of www.Hotmail.com

Tanika Co Valda said...

Great Article
Final Year Project Domains for CSE
Project Centers in Chennai



JavaScript Training in Chennai
JavaScript Training in Chennai

SEO KILLER said...

“I really loved reading your blog. It was very well authored and easy to understand” China SEO Company

NOOR said...

Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you. Webmetrix Group Search Engine Optimization

SEO KILLER said...

SEO Internet marketing can help any company through their site to sell products SirLinksalot Search engine optimization is not easy, but with the right SEO tools, your website promotion task just got a lot easier

fortnite said...

This higher conversion rate is simply one more of the advantages of SEO services that can't be matched by any other form of marketing. review You can use keywords in your description that can also be used as tags.

Navin Prakash said...

Such a nice article thanks for sharing this with us. Really so impressible and interesting post. You’re doing a great job Man, Keep it up.
Excel Training in Chennai
Excel Course in Chennai
Tableau Training in Chennai
Linux Training in Chennai
Oracle Training in Chennai
Advanced Excel Training in Chennai
Graphic Design Courses in Chennai
Oracle DBA Training in Chennai
Pega Training in Chennai
corporate training in chennai
Power BI Training in Chennai
Excel Training in Anna Nagar

akshaya said...

This jot down is more responsible and resourceful.I could see the great effort taken by you to make the write-up more sensible. Web Designing Course Training in Chennai | Web Designing Course Training in annanagar | Web Designing Course Training in omr | Web Designing Course Training in porur | Web Designing Course Training in tambaram | Web Designing Course Training in velachery

Pankaj Singh said...

Thanks for this amazing blog, visit Ogen Infosystem for creative web design and development services at an affordable price.
Best Website Designing Company in Delhi

Nora Pittman said...

Crypto-currency as a modern form of the digital asset has received a worldwide acclaim for easy and faster financial transactions and its awareness among people have allowed them to take more interest in the field thus opening up new and advanced ways of making payments. Crypto.com Referral Code with the growing demand of this global phenomenon more,new traders and business owners are now willing to invest in this currency platform despite its fluctuating prices however it is quite difficult to choose the best one when the market is full. In the list of crypto-currencies bit-coins is one of the oldest and more popular Crypto.com Referral Code for the last few years. It is basically used for trading goods and services and has become the part of the so-called computerized block-chain system allowing anyone to use it thus increasing the craze among the public, Crypto.com Referral Code.

Common people who are willing to purchase BTC can use an online wallet system for buying them safely in exchange of cash or credit cards and in a comfortable way from the thousands of BTC foundations around the world and keep them as assets for the future. Due to its popularity, many corporate investors are now accepting them as cross-border payments and the rise is unstoppable. With the advent of the internet and mobile devices,information gathering has become quite easy as a result the BTC financial transactions are accessible and its price is set in accordance with people’s choice and preferences thus leading to a profitable investment with Crypto.com Referral Code. Recent surveys have also proved that instability is good for BTC exchange as if there is instability and political unrest in the country due to which banks suffer then investing in BTC can surely be a better option. Again bit-coin transaction fees are pretty cheaper and a more convenient technology for making contracts thus attracting the crowd. The BTC can also be converted into different fiat currencies and is used for trading of securities, for land titles, document stamping, public rewards and vice versa.

Another advanced block-chain project is Ethereumor the ETH which has served much more than just a digital form of crypto-currency Crypto.com Referral Code and its popularity in the last few decades have allowed billions of people to hold wallets for them. With the ease of the online world,the ETH have allowed the retailers and business organizations to accept them for trading purposes, therefore, can serve as the future of the financial system.

Unknown said...

Water bodies are the main source of transportation for international freight forwarding. Due to this, sea freight company in Delhi,
visit
Freight Forwarder in Vietnam
Shipping Company In India

Unknown said...


visit here
iso certification in delhi
iso certification in noida
iso certification in gurgaon
iso certification in faridabad

Unknown said...

BUY EMAIL LIST FROM RIGHT PROVIDER
Email is a personal way of making contact to your prospects. And since it is a private message, trust and connection are built already. purchase email lists The conversion rate is also higher compared to mainstream media due to low operational and overhead costs. On top of that, email is easier to monitor and evaluate than printed materials. Through email marketing, you can jumpstart your b2b lead generation regardless of what type of industry you are in. The first step to buy email list for marketing is choosing the right email list provider. You need to buy email list to get ahold of the valuable information of your would-be clients for your brand. In this way, it will be easier for you to search for businesses, find contact persons and decision makers and go about your product and services.

freya maya said...

Internet Download Manager Crack ed Download
If you cannot afford to purchase the Internet Download Manager sequential number in the (moment), then it is possible to readily download the online download manager crack version. Don't stress IDM Crack can also be full edition, you may down load the deciphered IDM from the URL given below or you need to utilize IDM serial number to register the online downloadmanager.
Once we know, there are many IDM busted models are available and also the Internet download manager limitation is also available. Still, if you are a person who can readily afford the applications, then you must purchase the applications as it ailing help the programmers to pay for their bills also to spend the money generated by sales of the Internet download manager or even IDM crack full variant in making the software easier and much more useful because new features also cost the company in execution and research. You can purchase the original IDM full variant through their official site.

Huongkv said...

Đại lý Aivivu chuyên cung cấp vé máy bay, tham khảo

vé máy bay tết Vietjet

vé máy bay đi Mỹ hạng thương gia

vé máy bay đi Pháp khứ hồi

vé máy bay từ đà nẵng đi hàn quốc

vé máy bay đi nhật bản khứ hồi

giá vé máy bay đi Anh quốc

vé máy bay giá rẻ khứ hồi

how to rank your website or youtube channel (basic) said...

AirBNB management services in Dubai is a DTCM licensed holiday home Operator managing vacation rental villas and apartments for short and mid term stay in Dubai.

Unknown said...

Friendly Finance is South Africa's number 1 choice for finance - providing customers with all the information they need to make better financial decisions. FriendlyFinance We provide hundreds of comparisons of common consumer finance products, such as personal loans, car loans, short-term loans and credit cards. Think of us as a helping hand in selecting consumer finance products.