Project

gace

0.0
No commit activity in last 3 years
No release in over 3 years
GACE is a simple way to integrate content experiments into your Rails application
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Build Status

GACE

Google Analytics Content Experiments + Rails = AWESOME

Installation

Add this line to your application's Gemfile:

gem 'gace'

Update your view layout to include the necessary javascript. Make sure to include the javascript at the very top of your head element (per Google Analytics installation instructions).

<<!DOCTYPE html>
<html>
<head>
  <%= gace_javascript_include %>
</head>
<body>
</body>
</html>

Usage

Setup experiment in Google Analytics

Configure each variation with a different gace_var parameter value.

example:

  • control: http://mysite.com/signup
  • variation one: http://mysite.com/signup?gace_var=expensive
  • variation two: http://mysite.com/signup?gace_var=cheap

Make sure to record the newly created experiment ID.

Configure the experiment within Rails

class UsersController < ApplicationController
  def show
    define_experiment :test_pricing, '28391929-0'
  end
end

Create views for experiment variations

  1. Create a directory for the experiment: app/experiments/EXPERIMENT_NAME (ex: app/experiments/test_pricing)
  2. Create a directory for each experiment variation. The directory name must match the gace_var parameter used when setting up the experiment in Google Analytics. (ex: app/experiments/test_pricing/expensive and app/experiments/test_pricing/cheap)
  3. Create any views/partials to be used for that variation. Each directory should mirror structure used by app/views and will override the default views if one exists. (ex: app/experiments/test_pricing/expensive/users/show.html.erb)

Contributing

  1. Fork it ( https://github.com/thegarage/gace/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Related Projects