Ruby on Rails Saturday, August 17, 2013


On Saturday, August 17, 2013 2:04:51 PM UTC-7, Linus Pettersson wrote:
Hi

Often when I build sites I need some way to track visits to specific pages. For instance I need to see what Artists are the most popular so I can let my users sort based on popularity.
I have used the gem Impressionist before but recently I ran into major performance issues (see https://github.com/charlotte-ruby/impressionist/issues/94).

I do use Google Analytics and _could_ pull that data somehow I guess, but isn't that data pretty "slow" (I want the views to update at least in a few minutes)?

So, what do you use to track views in your apps?


FIrst I would say you need to crack the nut of what "popular" means.  Simple URL hits may not be your best metric for that.  It could mean how long a user dwells on a page, or how many scroll all the way to the bottom, who's logged in vs. who's a casual users or an indexing bot, etc.

Assuming "artists" is a table, you could add a simple counter column (maybe with a related "counter_reset_at" column with a timestamp) and increment it when the appropriate criteria is met.

When I first made a popular T-shirt site (I'll refrain from saying the name here) we used to have a 'Like' feature similar to Facebook.  We found users would systematically set up new accounts and like themselves and dislike everybody else to try to falsify their ratings.  We came up with some simple ways to weed out the bad data.

Hope this helps.


Phil

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9e41cd1f-c4e9-46b1-a34d-088a3b1254ac%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment