Links
HitTracker
Categories
HitTracker
HitTracker can easily give you the functionality you need to track page views, most emailed, most whatever.
Note: Not ideal for enterprise level sites.
1. Add this migration:
create_table :hits do |t|
t.column :hittable_type, :string
t.column :hittable_id, :integer
t.column :kind, :string
end
2. Add this to a model you want to track:
track_hits
3. In your controller, when you want to save a hit, do this:
hit(@object, ‘PageView’) # replace ‘PageView’ with a unique identifier for the type of hit.
the hit method works on collections too!
4. Access an objects hits:
@object.hits # returns a collection
@object.hit_count # returns an integer
Vitals
| Home | http://elctech.com/2007/9/5/hit-tracker-plugin |
|---|---|
| Repository | http://svn.elctech.com/svn/public/plugins/hit_tracker |
| License | Rails' (MIT) |
| Tags |
hits pageviews
|
| Rating | (4 votes) |
| Owner | josh stephenson |
| Created | 9 September 2007 |

