Is there a good gem to track/log user activities on the site? Like when they sign in, sign out, or perform an action that changes something on the site (non GET requests in general).
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
相关文章
- Ruby using wrong version of openssl
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
There is a ruby gem called Action Tracker. I built and use it and it should do exactly what you need (since you use Rails and Devise).
The link is https://github.com/appprova/action_tracker
There are some contribution from outside our core team too (people are using it). You are welcome to try and send feedback!
I briefly investigated several similar-purposed gems including: PaperTrail, Vestal versions, audited, Acts as versioned, Userstamp , and found that:
PaperTrail, Vestal versions and Acts as versioned are all very powerful versioning gem. Yes, you can also use it to audit/track users' activities , but it's not very straight forward because they are 'versioning tools', but not for the 'auditing purpose'
Userstamp and audited are for auditing purposing only. but Userstamp is for older Rails versions ( it's a plugin... which is not supported by Rails3(or 3.1, 3.2?) anymore )
so I think 'audited' is a better choice for auditing user activities purpose (not considering model versioning) for Rails3, this is enough for me. Further more, it supports associations and ActiveRecord/MongoMapper.
I hope this helps.
This is a follow up. I've been using a gem called public_activity. https://github.com/pokonski/public_activity. It's pretty simple to install and setup.
It depends on why you are looking for those informations. Papertrail or similar can track changes in models easily, see Siwei Shen:s answer for better infos. Also public_ativity type of gems can be used if you are looking on how to make a public feed based on user actions.
Then again if you wan't to do growth hacking or analyze otherwise what are the user flows. It's often easier just to do some custom logging. Create a long text field next to the model and add a line every time something interesting happens. Works well if you wan't occasionally to crunch some data on how users are using the service and how changes in the site affect long term usage.
See https://github.com/holli/referer_tracking for example of this type of approach.
paper_trail is usually used to track changes in object. If you want to track actions (like a movie, sign in, read a book etc) pfeed is a good candidate
Yes there are. Here is one, paper trail. https://github.com/airblade/paper_trail
Its main prupose is to versioning models but I think its also good for your use case since it registers who made each version.
For more gems search at ruby toolbox. Here are the categoties that you should check in this case
https://www.ruby-toolbox.com/categories/Active_Record_User_Stamping
https://www.ruby-toolbox.com/categories/Active_Record_Versioning
Maybe Userstamp is actually better for your use case.