Gem to track User Activity [closed]

2019-03-18 16:58发布

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).

6条回答
\"骚年 ilove
2楼-- · 2019-03-18 17:09

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!

查看更多
三岁会撩人
3楼-- · 2019-03-18 17:19

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.

查看更多
迷人小祖宗
4楼-- · 2019-03-18 17:21

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.

查看更多
倾城 Initia
5楼-- · 2019-03-18 17:21

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.

查看更多
叼着烟拽天下
6楼-- · 2019-03-18 17:26

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

查看更多
冷血范
7楼-- · 2019-03-18 17:33

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.

查看更多
登录 后发表回答