Topic: Best Way To Track User Activity

I've seen a similar thread on this forum before, but no solution was posted so here it comes again...

I'm looking to track user activity across several models (i.e. uploading photos, posting comments, etc.). 

What is the best way of tracking user activity across an entire rails application? 

Should I use an observer, a sweeper, create a tracker model or is there another option I haven't thought of yet?

I'm looking for a nudge in the right direction here or to spark a conversation on the subject.


Re: Best Way To Track User Activity

Google Analytics

Re: Best Way To Track User Activity

Maybe you need to use call back function such as before_create or after_update. Have a look at it.

Re: Best Way To Track User Activity

A tracking model is an ok way of doing this, storing stuff like what the action was, who made the action, when it was done etc.

The downside of this is that if you have a lot of clicks and you don't really need the information then your database can get ridiculously huge and have adverse effects on performance so have a good think about what you really need to track and what kinds of things you can use Google Analytics for.

Re: Best Way To Track User Activity

digitalkillroy -- are you trying to build an 'activity feed' similar to what you see on Facebook?  Sounds like you're only interested in certain actions a user takes ... and that you'd like them to be able to view a summary of certain events, like uploading photos, posting comments, etc. -- is that correct?

Re: Best Way To Track User Activity

Sherpa - That's it exactly.

An observer seems too limited, I can't find a lot of info on how to use a sweeper and a tracker model would need to have it's hooks in a lot of different places. 

I'm looking for more advice on which route would be best as I look into the pros and cons.