A Rails engine to add Gauges tracking code to Rails apps.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
spec Require Ruby >= 1.9. May 3, 2012
vendor/assets/javascripts Create Gem. Mar 29, 2012
.gitignore Create Gem. Mar 29, 2012
.travis.yml Update Ruby versions for Travis. Oct 3, 2014
CHANGELOG.md Release 0.2.2. Oct 3, 2014
Gemfile Create Gem. Mar 29, 2012
LICENSE Create Gem. Mar 29, 2012
README.md Update Travis badge in README. Oct 3, 2014
gauges-rails.gemspec Relax version requirement to support Rails 4. Oct 3, 2014



Build Status

A Rails engine to add Gauges tracking code to Rails apps.


Add this line to your application's Gemfile:

gem 'gauges-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gauges-rails


Set your Gauges site ID in the config/application.rb file:

config.gauges.site_id = GAUGES_SITE_ID

Your site ID can be found on the Gauges dashboard under "Tracking Code".


Include the JavaScript tracking code at the bottom of your layout template:

<%= javascript_include_tag('gauges') %>

Or, if your template is using Haml:

= javascript_include_tag('gauges')

While Gauges suggests placing this code right before the closing &lt/body> tag, if you'd rather add it inline with the rest of your JavaScript code, you can add it to the bottom of your app/assets/javascripts/application.js file:

//= require gauges

If you'd only like the tracking code to be included in the production environment, create a file like app/assets/javascripts/tracking.js.erb with the following:

<% require_asset 'gauges' if Rails.env.production? %>


  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Added some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create a new Pull Request.


Thanks to Jason Coene for creating the original version of this Gem.


Copyright © 2012 Tyler Hunt. See LICENSE for details.