Fetching contributors…
Cannot retrieve contributors at this time
347 lines (239 sloc) 13.9 KB
== 1.7.0 (Pending)
1.7.0 adds support for ActionMailer, for example:
class UserMailer < ActionMailer::Base
def invite_email(user)
use_vanity_mailer user
mail :to =>, :subject => ab_test(:invite_subject)
See the documentation for more details.
With 1.7.0 and moving forward, if you need to setup a database schema
(relational databases only), please use the generator:
$ rails generate vanity
$ rake db:migrate
Rails generator for AR migrations (Zaid Zawaideh)
A/B testing in ActionMailer (Joseph Sofaer)
== 1.6.1 (2011-07-20)
Fixed cookie domain setting.
== 1.6.0 (2011-07-18)
If robots or spiders make up a significant portion of your sites traffic they
can affect your conversion rate. Vanity can optionally add participants to the
experiments using asynchronous JavaScript callbacks, which will keep almost all
robots out. To set this up simply do the following:
1. Vanity.playground.use_js!
2. Set Vanity.playground.add_participant_path = '/path/to/vanity/action'
3. Add <%= Vanity.vanity_js %> to the bottom of any view that needs to set up
an ab_test
Fix for metrics on rails 3 models (Esteban Pastorino).
Use JavaScript to report participants, useful for ignoring bots on publicly
accessible pages (Doug Cole).
AbTest#choose returns an Alternative rather than just the value (Doug Cole).
Add warnings instead of swallowing errors (Anthony Eden).
Fixing broken test for mongodb adapter (Joshua Krall).
Fix returning correct experiment when in test mode and manually set via
#chooses (Ryan Sonnek).
Don't round the conversion rate before using it, it affects the test results,
making them less accurate (Doug Cole).
Fixed loading config from yml when using other than redis adapter (Arttu Tervo)
Default to localhost unless host in config file (Arttu Tervo)
Fixed mongo connection adapter connect! when called after disconnect! (Arttu
Use mongo replica set connection if multiple hosts were given in YAML
configuration file (Arttu Tervo)
Cookie domain from rails configuration (Arttu Tervo)
Add bson_ext to Gemfile to load C extension for mongodb ruby driver, and
prevent Notice messages as the tests run (tenaciousflea)
Update redis-namespace dependency to 1.0 (Ville Lautanala)
== 1.5.3 (2011-04-11)
Added number of participants and number of converted participants to ab_test
template (Avishai Weiss).
== 1.5.2 (2011-04-11)
Fixed to work with redis-rb 2.2.0 (Kevin Menard).
Fixed to work with Postgresql: it complained that the index names generated by
add_index were too long, so I gave them shorter names (Robert Rasmussen).
Fixed SQL errors comparing an int to a varchar column, and no "as" on a column
alias (Robert Rasmussen).
Fixed auto-escaped text in the experiment template that I marked as html_safe
(Robert Rasmussen).
Added some Rails 3.x documentation to the 2-minute demo instructionsa (Andy Atkinson).
Fix to set collecting flag from vanity.yml config file.
== 1.5.1 (2010-12-20)
Fixes some minor bugs in RoR when including the Dashboard (netguru)
== 1.5.0 (2010-10-23)
Note: MongoDB URI scheme changed from mongo: to mongodb: to be consistent with
the rest of the civilized world. If you get an error because Vanity can't find
the MongoDB adapter, fear not! It's still there, just need to update your
config/vanity.yml file.
Rails 3 support (Adam Keys, Stephen Celis, Brian Leonard, Ryan Carver)
Changed MongoDB URI scheme from 'mongo://' to the standard 'mongodb://' and
renamed the mongodb adapter filename to make it match (JS Boulanger)
Added support for ERB in YAML configuration files (JS Boulanger)
Fixed initialization of playground's Rails defaults such that they can be
overriden in the environment (JS Boulanger)
== 1.4.0 (2010-08-06)
Note: Run this command to upgrade your database to 1.4, or you will not have
access to collected metrics and experiment data:
vanity upgrade
Connection adapters! We have a new way for managing connections which extends
to multiple adapters (not just Redis). The easiest is to use the configuration
file config/vanity.yml. For example:
adapter: redis
adapter: mongodb
We get to keep Redis, add new MongoDB adapter, but lose Mock. It's still there,
but there's a new way to use Vanity outside production: you can turn data
collection on/off.
Under Rails, data collection is turned off in all environments except
production. To turn if on/off:
Vanity.playground.collecting = true/false.
This release switches to latest Redis gem and uses redis-namespace (what took
me so long?) If your own code relies on the Redis gem, watch out: there are
some subtle incompatibilities between 1.x and 2.x.
Now using RVM, gemsets and Bundler to test Vanity in different configurations.
To run the full set of tests in all the supported versions of Ruby:
rake test:rubies
To test specific version of Ruby:
rake test:rubies[1.8.7]
To switch around:
rvm 1.9.2@vanity
* Added: Adapter API, see Vanity::Adapters::AbstractAdapter and
* Added: MongoDB support.
* Added: Upgrade command.
* Added: Metric.last_update_at.
* Added: Vanity.playground.collecting. You want this to be true only in
production environment. When false, disables collecting of metric and
experiment data.
* Added: Remote metrics. Push data to remote service.
* Added: Partial support for multi-series metrics. Laying the ground for the
* Change: Vanity.playground.redis and redis= methods are deprecated, use
connection and establish_connection instead.
* Removed: Metric.created_at, derived from experiment and never used.
== 1.3.0 (2010-03-01)
This release adds support for Google Analytics, AdWords and forking servers
(Passenger, Unicorn).
To view Google Analytics metrics from within Vanity, first make sure you are
using Garb. For example, in your Gemfile:
gem "vanity", "1.3.0"
gem "garb", "0.5.0"
Next, authenticate using your account credentials. For example, in your
require "garb"
Garb::Session.login('', '..password..', account_type: "GOOGLE") rescue nil
Last, define Vanity metrics that tap to Google Analytics metrics. For example:
metric "Acquisition: Visitors" do
description "Unique visitors on any given page, as tracked by Google Analytics"
google_analytics "UA-1828623-6", :visitors
* Added: Support for Google Analytics metrics, thanks to Tony Pitale's Garb and blog post:
* Added: Vanity query parameter that you can use to choose a particular alternative, e.g. to tie an advertisement banner with content of the site.
* Added: Command line "vanity list" catalogs all ongoing experiments, their alternatives (and fingerprints) and all metrics.
* Added: Playground.reconnect!, particularly useful when forking (Passenger, Unicorn, etc).
* Added: Vanity loads Redis configuration from config/redis.yml (if you have such a file).
* Changed: New way to specify connection configuration: Vanity.playground.redis = "localhost:6379". Use this instead of the separate host/port/db attribute.
* Changed: Rails integration now separates use_vanity method, filters and helpers.
* Changed: Explicit vanity_context_filter and vanity_reload_filter so you can skip them, or order filters relative to them.
* Fixed: If metric cannot be loaded (e.g. offline, no db access) show error message for that metric but don't break dashboard.
* Fixed: AbTest incorrectly calls identify method instead of identity (issue #2)
* Fixed: Running vanity command, automatically detects and loads Rails.
* Fixed: Vanity now picks up on load_path set from within config/environment.rb.
* Removed: Vanity.playground.define is deprecated. Bad choice for a method name. If you need this feature, make a suggestion and let's create a better API.
== 1.2.0 (2009-12-14)
This release introduces metrics backed by ActiveRecord. Use them when your model is already tracking a metric, and you get instant historical data.
Example, track sign ups using User model:
metric "Signups" do
model Account
Example, track satisfaction using Survey model:
metric "Satisfaction" do
model Survey, :average=>:rating
Example, track only high ratings:
metric "High ratings" do
model Rating, :conditions=>["stars >= 4"]
There's no need to call track! on these metrics.
* Added: Metrics backed by ActiveRecord.
* Added: track! and ab_test methods now available from Object (i.e. everywhere).
* Added: Playground.load!. Now loading all metrics and experiments from Rails initializer.
* Changed: Decoupled metric name from identifier. You can now define a metric with more descriptive name, e.g. "Cheers per second (user satisfaction)" and keep their ID simple. Identifier is matched against the file name (for metrics loaded from experiments/metrics).
* Changed: Metrics no longer defined on-demand, i.e. calling playground.metric either returns existing metric or raises exception.
* Changed: Playground.experiments returns hash instead of array.
* Changed: All dates in report are UTC, since we don't know which locale to use.
* Removed: Object.experiment is deprecated, please call Vanity.playground.experiment directly.
* Fixed: Playground no longer changes logging level on supplied logger.
== 1.1.1 (2009-12-4)
* Fixed: Binding issue that shows up on 1.8.6/7.
== 1.1.0 (2009-12-4)
This release introduces metrics. Metrics are the gateway drug to better software.
It’s as simple as defining a metric:
metric "Cheers" do
description "They love us, don't they?"
Tracking it from your code:
track! :cheers
And watching the graph from the Dashboard.
You can (should) also use metrics with your A/B tests, for example:
ab_test "Pricing options" do
metrics :signup
alternatives 15, 25, 29
This new usage may become requirement in a future release.
Much thanks to Ian Sefferman for fixing issues with Ruby 1.8.7 and Rails support.
* Added: Metrics.
* Added: Use Vanity.playground.mock! when running tests and you'd rather not access a live Redis server.
* Changed: A/B tests now using metrics for tracking.
* Changed: Now throwing NameError instead of LoadError when failing to load experiment/metric. NameError can be rescued on same line.
* Changed: New, easier URL mapping for Dashboard: map.vanity "/vanity", :controller=>:vanity.
* Changed: All tests are green on Ruby 1.8.6, 1.8.7 and 1.9.1.
* Changed: Switched to redis-rb from
* Deprecated: Please call experiment method with experiment identifier (a symbol) and not experiment name.
== 1.0.0 (2009-11-19)
This release changes the way you define a new experiment. You can use a method suitable for the type of experiment you want to define, or call the generic define method (previously: experiment method). For example:
ab_test "My A/B test" do
alternatives :a, :b
The experiment method is no longer overloaded: it looks up an experiment (loading its definition if necessary), but does not define an experiment. The ab_test method is overloaded, though this may change in the future.
In addition, the ab_goal! method is now track!. This method may be used for other tests in the future.
* Added: A/B test report now showing number of participants.
* Added: AbTest.score method accepts minimum probability (default 90), and
* Removed: Experiment.reset! method. Destroy and save have the same effect.
* Changed: Playground.define now requires an experiment type, ab_test is not the default any more.
* Changed: When you run Vanity in development mode (configuration.cache_classes = false), it will reload experiments on each request. You can also Vanity.playground.reload!.
* Changed: Fancy AJAX trickery in Rails console.
* Changed: You can break long experiment descriptions into multiple paragraphs using two consecutive newlines.
* Changed: AbTest confidence becomes probability; only returns choice alternative with probability equal or higher than that.
* Changed: ab_goal! becomes track!.
* Changed: Console becomes Dashboard, which is less confusing with rails console (script/console).
== 0.3.1 (2009-11-13)
* Changed: Redis 1.0 is now vendored into Vanity. This means one less dependecy ... actually two, since Redis brings with it RSpec.
== 0.3.0 (2009-11-13)
* Added: score now includes least performing alternatives, names and values.
* Added: shiny reports.
* Added: Rails console shows current experiments status and also allows you to choose which alternative you want to see.
* Changed: letters instead of numbers for options (option 1 => option A).
* Changed: experiment.alternatives is now an immutable snapshot.
* Changed: experiment.score returns populated alternative objects instead of structs.
* Changed: experiment.chooses uses Redis to store state, better for (when we get to) browser integration.
* Changed: experiment.chooses skips recording participant or conversion.
* Changed: to MIT license.
== 0.2.2 (2009-11-12)
* Added: vanity binary, with single command for generating a report.
* Added: return alternative by value from experiment.alternative(val) method.
* Added: reset an experiment by calling reset!.
* Added: experiment alternative name (option 1, option 2, etc).
* Added: new scoring algorithm: use experiment.score instead of alternative.z_score/confidence.
* Added: experiment.conclusion for plain English results.
== 0.2.1 (2009-11-11)
* Added: z-score and confidence level for A/B test alternatives.
* Added: test auto-completion and auto-outcome (complete_it, outcome_is).
* Changed: default alternatives are now false/true, so if can't decide outcome, fall back on false.
== 0.2.0 (2009-11-10)
* Added: experiment method on object, used to define and access experiments.
* Added: playground configuration (Vanity.playground.namespace = , etc).
* Added: use_vanity now accepts block instead of symbol.
* Changed: Vanity::Helpers becomes Vanity::Rails.
* Changed: A/B test experiments alternatives now handled using Alternatives object.
* Removed: A/B test measure method no longer in use.