Skip to content

Easily add multiple online javascript metric system to your app

License

Notifications You must be signed in to change notification settings

jvnill/track_me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Easily add multiple online javascript metric system to your app

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages