Project

uu_counter

0.0
No commit activity in last 3 years
No release in over 3 years
UUCounter is the plugin to trace unique user pageviews with easy integration. It is inspired by [Ahoy](https://github.com/ankane/ahoy), but limited to a few functions for simplicity.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 4.2.1
 Project Readme

[WIP] UUCounter¶ ↑

## Overview

UUCounter is the plugin to trace unique user pageviews with easy integration. It is inspired by [Ahoy](github.com/ankane/ahoy), but limited to a few functions for simplicity.

## Installation

In your Gemfile,

“‘ gem ’uu_counter’ “‘

After installation, copy the migration files to your project.

“‘ rake uu_counter:install:migrations “`

## Overview

This command will generate pageview tracing model. Table schema is…

“‘ id: integer uuid: string path: string created_at: datetime updated_at: datetime “`

You can get the count of UU in the specified path through a module function.

“‘ UUCounter::Accessor#get_count(path): Returns UU count to the path “`

## Usage

At first, write this line on your project’s config/routes.rb.

“‘ mount UuCounter::Engine => “/uu_counter” “`

In the page you’d track pageview, you should embed this js script.

“‘ $(function(){

UUCounter.track();

}); “‘

And you must assign schema to your database with ‘db:migrate` After that, when you check UU count, you can get it with following code.

“‘ class TestController < ActionController::Base

...
def foo
    @pageview_count = UUCounter::Accessor.get_count("/test/path")
end
...

end “‘

This project rocks and uses MIT-LICENSE.