Project

track_me

0.0
No commit activity in last 3 years
No release in over 3 years
Easy way to add a metric system using javascript and known metric saas
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

TrackMe

Build Status

This is a gem that allows you to easily add javascript based metric systems like kissmetrics and mixpanel to your application.

Installation

Add this line to your application's Gemfile:

gem 'track_me'

And then execute:

$ bundle

Or install it yourself as:

$ gem install track_me

After installing the gem, you need to run the generator that will install a few files.

$ rails g track_me:install

Usage

In your controllers, call trackme and pass in the name of the action and the string that will be used to describe the action. You can also pass in a hash with a key called 'object' which will be used for sending the details of the object.

class CommentsController < ActionController::Base
  trackme index: ['Visited the comments index page'],
         create: ['Created a comment', object: 'comment']

  def index
  end

  def create
    @comment = ...
  end
end

Contributing

  1. Fork it
  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 new Pull Request