Skip to content

Use Split with Heroku RedisToGo

PikachuEXE edited this page Nov 23, 2012 · 1 revision

It is very easy.
As mentioned in readme you can set the redis connection url
And since there is an ENV inside Heroku if you use RedisToGo, just use it:

# Make Split use Redis To Go on Heroku
Split.redis = ENV["REDISTOGO_URL"] if ENV["REDISTOGO_URL"]

Here is a config file of mine :)

# config/initializers/split.rb
Split.configure do |config|
  # config.robot_regex = /my_custom_robot_regex/ # Should set it
  # config.ignore_ip_addresses << '81.19.48.130' # You should set it using SettingsLogic or something
  config.db_failover = true # handle redis errors gracefully
  config.db_failover_on_db_error = proc{|error| Rails.logger.error(error.message) }
  config.allow_multiple_experiments = true # It's fine for me, but might not for you
  config.enabled = true
end

Split::Dashboard.use Rack::Auth::Basic do |username, password|
  username == 'fire_in' && password == 'the_hole' # This one is fake :P
end

Split.redis.namespace = "split:blog" # Any name you want

# Make Split use Redis To Go on Heroku
Split.redis = ENV["REDISTOGO_URL"] if ENV["REDISTOGO_URL"]

Happy A/B Testing! :3

Clone this wiki locally