Smooch allows you to:
Define a user's unique identifier and uses the API to associate it later if not logged in yet
Define A/B tests and makes the decision in your Ruby code
Record events in your Ruby code
Use the same code in your views for development a production but not KISSmetrics about development actions or for other reasons
class ApplicationController < ActionController::Base kiss :current_user end
def new km.record("Signup page viewed") if km.ab("Show faces in sidebar", ["yes", "no"]) == "yes" @profiles = User.good_looking.limited(5) end @user = User.new end def create @user = User.new(params[:user]) if @user.save km.set("User zipcode", @user.zipcode) km.record("Signup converted") redirect_to @user else render :new end end
<%= render 'faces', :users => @profiles if @profiles %> ... <%= f.text_field :zipcode <%= submit_tag km.ab("Signup Button Text", ["Go!", "Submit"]) %>
<html> <head> ... <%= km.script %> </head>
production: apikey: kiss_metrics_api_key_here
km.script will report the data to KISSmetrics if there is a line in kissmetrics.yml for your environment. In the above example it would have reported the choices about showing faces in the sidebar and the button text as well as the conversion points noted. This would have all been correlated to the user's new id and have set the zipcode if they were successful in the signup.
You can also pass a boolean variable into the call as follows:
We use this to opt-out site admins from our metrics for more relevant results.
Smooch replicates some of the A/B behaviors of the KISSmetrics library by using (it's own) cookies to remember decisions and be consistent.
Several tactics used from other reporting libraries such as vanity.
Copyright (c) 2011 Brian Leonard, released under the MIT license