Sha256: f08b1232add65e50072b6e53bbad574999f19f070121825b693c29f923425330

Contents?: true

Size: 1.41 KB

Versions: 12

Compression:

Stored size: 1.41 KB

Contents

= Cohortly

The beginings of an engine to do basic cohort analysis on a feature basis.

== Configuration

=== Mongo database config

Setup a cohortly.yml file in your config directory

  production:
    host: localhost
    port: 27017
    username: nyusername
    password: mypassword
    database: cohortly-production

=== Application controller config

Setup cohortly notifications by letting it know who your user is and his start date.  
You also need to give cohortly the controller and action.

  class ApplicationController < ActionController::Base
    before_filter do
      if current_user.logged_in?
        ActiveSupport::Notifications.instrument("cohortly.event",  { 
                :user_start_date => current_user.created_at,
                :user_id         => current_user.id,
                :controller => params[:controller],
                :action => params[:action]
               })
      end
    end
  end

===  Tag Config

The tag config maps controllers and actions to tags that get added to the metrics that are recorded.

In confg/initializers/cohortly.rb

  Cohortly::TagConfig.draw_tags do
    tag :login do
      controller :session do
        actions :create
      end
    end
    tag :logout do
      controller :sessions do
        actions :destroy
      end
    end
    tag :view_account do
      controller :account do
        actions :show
      end
    end
  end


This project rocks and uses MIT-LICENSE.

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cohortly-0.0.93 README.rdoc
cohortly-0.0.92 README.rdoc
cohortly-0.0.9.1 README.rdoc
cohortly-0.0.9 README.rdoc
cohortly-0.0.8 README.rdoc
cohortly-0.0.7 README.rdoc
cohortly-0.0.6 README.rdoc
cohortly-0.0.5 README.rdoc
cohortly-0.0.4 README.rdoc
cohortly-0.0.3 README.rdoc
cohortly-0.0.2 README.rdoc
cohortly-0.0.1 README.rdoc