ScienceGist / sciencegist

ScienceGist - Science for everyone
http://www.sciencegist.com
MIT License
15 stars 3 forks source link

A simple stats dashboard for every user #19

Open jure opened 10 years ago

jure commented 10 years ago

We need to close the loop and show our contributors what impact their gists are having. We can start doing that by building a really simple dashboard, that just shows a neat graph of how many unique visitors each gist has received, and also displaying that number on the gist itself, publicly.

jure commented 10 years ago

The following are just some notes I made about this feature:

We need to build user facing analytics, the technology I propose to use to store this data is Redis.

What do we want the users to see?

  1. Page view counts for their gists, papers and profile
  2. Referers, user countries for their gists, papers and profile

How do we store this?

The page views we store like counters in redis and just increment that, e.g. INCR paper:34:views. But how do we prevent manipulation, i.e. only count uniques? Look at how impressionist does this, as their whole schtick is that they record impressions.

For every visit, we also need to keep information about ip, browser and referrers.

We could store these in hashes in redis sets. How do other people do this?

This looks like it covers most of the basics: http://www.ebrueggeman.com/blog/redis-visitor-tracking

For the dashboard/charts themselves, this looks like a good example to learn from: https://github.com/saturnine/redis_analytics