[ckan-dev] Page view tracking feature, status

Sean Hammond sean.hammond at okfn.org
Thu May 30 15:07:46 UTC 2013


Hey, as agreed here's a summary of the status of CKAN's internal page
view tracking feature.

Docs were written in time for 2.0:

http://docs.ckan.org/en/ckan-2.0/tracking.html

We've currently got 5 github issues related to tracking:

https://github.com/okfn/ckan/issues?labels=Tracking&milestone=&page=1&state=open

(I'm aware that there are some unchecked checkboxes on pull request 730,
seperate github issues were made for each of these, they're in the 5
issues above.)

The two main bugs are:

- Visiting a resource's page (and previewing the resource) doesn't count
  towards the resources view count (only downloading the resource does)

- Previewing or downloading one of a dataset's resources doesn't count
  towards the dataset's view count (only visiting the dataset's own page
  does)

- No tests

As described in the github issues, I think we need some new logic for
how we do dataset and resource view counting:

- Either viewing a resource's page or downloading a resource counts towards
  that resource's view count, max one view per person per day.

So for example if I first load a resource's page, then download the
resource, that increases the resource's view count by 1, and not by 0 or
2. (And any further previews or downloads I do on the same day don't
increase the count anymore.)

- Viewing a dataset's page, viewing any of a datasets' resources' pages,
  or downloading any of a datasets resources, counts as a dataset view,
  again max one view per person per day.

So if, for example, I visit a dataset's page and then each of that
dataset's resources pages, and also download some of the resources, that
would increase the dataset's view count by 1 and also increase each of
the dataset's resource's view counts by 1.

This is quite a significant rewrite/extension of the tracking feature's
counting logic. Also the logic is currently written in SQL statements
that I personally find very hard to parse, so I'd probably want to
rewrite that code to do the logic in Python.

We won't be able to fit this work in next sprint, but I would be happy
take it on in the sprint after next.




More information about the ckan-dev mailing list