Giter VIP home page Giter VIP logo

retention_magic's Introduction

RetentionMagic

Simple cohorts analysis and retention graphs in your Rails app

RetentionMagic is a drop-in gem that uses your current models and records in your database to generate simple cohort analysis and retention graphs for your app. There is no need to integrate an external service or explicitly add event tracking code to your controllers or views. All data stays in your app.

Installation

In your Gemfile:

gem "retention_magic"

And run bundler:

$ bundle install

Then, generate the config/initializers/retention_magic.rb configuration file:

$ rails generate retention_magic

Configuration

Open config/initializers/retention_magic.rb and customize the sample configuration to your app.

Then, make the RetentionMagic page available on a route in your app. For example, in your config/routes.rb:

Rails.application.routes.draw do
  mount RetentionMagic::Engine => "/retention_magic"

  # your application routes
end

Securing the RetentionMagic route

Devise

If you want to secure that page and your app uses Devise, you can use the following routing snipper:

Rails.application.routes.draw do
  authenticated :admin do
    mount RetentionMagic::Engine => "/retention_magic"
  end

  # your application routes
end

Sorcery

The same can be be achieved in a similar manner with with Sorcery. Take a look at this Wiki page: https://github.com/NoamB/sorcery/wiki/Routes-Constraints

retention_magic's People

Contributors

michiels avatar rromanchuk avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

ikataitsev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.