0.01
No commit activity in last 3 years
No release in over 3 years
RetentionMagic is a drop-in gem for instantly generating insightful graphs that tell you how your app users are activating and how your app's retention and churn is.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3

Runtime

 Project Readme

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