Ticket #2251 (accepted enhancement) — at Version 8
Internal analytics for ckan.
Reported by: | kindly | Owned by: | toby |
---|---|---|---|
Priority: | major | Milestone: | ckan-sprint-2012-04-16 |
Component: | ecportal | Keywords: | 6d |
Cc: | Repository: | ckan | |
Theme: | none |
Description (last modified by rgrp) (diff)
Page views and Resources clicks need to be tracked.
User Stories
US1 As a Site Admin / Visitor (?) I want to see how often a page has been viewed (every page) and how often resources have been downloaded.
US1a Next to a resource or a dataset see how often it has been downloaded / viewed
US1b I want to see datasets or resources ranked by most downloaded or viewed
US1c See a trend graph for a dataset (and resources)
Adminstrative Dashboard (?)
- I want to see the traffic breakdown by country to my site ...
- Ditto for browser type, language, etc etc
- I want to see it graphed over time ...
Implementation Details
- How do we store this data in CKAN?
- How do we track (and store)?
- How do we display
- Config option (ini file - config/deployment.ini_tmpl) ckan.status.enabled = False (by default)
Storing Data
How does ckanext-googleanalytics do this? Current table:
package_id | count_recent | count_total
Move to a new stats_summary table
id | item_id | object_type | stats_type (total, month_yyyy_mm, ...) | value
Do we store this data into the search (solr) so we can search by it?
Displaying Data
- Helper functions / dictize:
- Helper function: h.stats_get(object_type, id, stats_type)
- h.stats_top_ranked(object_type, number) -> returns object_dicts or just labels or ...
- Change to dictize
- Helper function: h.stats_get(object_type, id, stats_type)
- Location in the default theme (do we show for example in search results too!)
- Support for ranking by most popular in search?
Tracking Data
- Our own solution (just write to site_tracking)
- Google analytics (plus extension for retrieving data) <- would need a refactor
- Piwiki
Own Solution
(For later: not as part of this ticket probably)
site_tracking table
id | url | timestamp | action (page_view, resource_download) |
- Make javascript to make request to ckan to store clicks and page views.
- Add middleware so these requests do not go through pylons and just store data quickly.
Change History
comment:2 Changed 2 years ago by rgrp
Big +1: everyone wants to know page views. Would like detail of how this goes into interface. Downloads already being tracked. Also isn't this just an extension to ckanext-googleanalytics.
comment:3 Changed 2 years ago by toby
- Status changed from new to accepted
not really part of ckanext-ga as we need to sit first in the middleware for speed reasons. I'm looking at recording the details and will do a summary page like ga extension.
As far as other uses like showing popular resources etc then we need to decide where the data will live - on the resource or separate.
Downloads tracked? where is this done in the code/data stored
comment:4 Changed 2 years ago by toby
notes from meeting 21-3-2012
US1 As a Site Admin / Visitor (?) I want to see how often a page has been viewed (every page) and how often resources have been downloaded. US1a Next to a resource or a dataset see how often it has been downloaded / viewed US1b I want to see datasets or resources ranked by most downloaded or viewed US1c See a trend graph for a dataset (and resources) Adminstrative Dashboard (?)
- I want to see the traffic breakdown by country to my site ...
- Ditto for browser type, language, etc etc
- I want to see it graphed over time ...
Implementation Details
- How do we store this data in CKAN?
- How do we track (and store)?
- How do we display
- Config option ckan.status.enabled = False (by default)
Storing Data
How does ckanext-googleanalytics do this? Current table: package_id | count_recent | count_total Move to a new stats_summary table id | item_id | object_type | stats_type (total, month_yyyy_mm, ...) | value Do we store this data into the search (solr) so we can search by it?
Displaying Data
- Helper functions / dictize:
- Helper function: h.stats_get(object_type, id, stats_type)
- h.stats_top_ranked(object_type, number) -> returns object_dicts or just labels or ...
- Change to dictize
- Helper function: h.stats_get(object_type, id, stats_type)
- Location in the default theme (do we show for example in search results too!)
- Support for ranking by most popular in search?
Tracking Data
- Our own solution (just write to site_tracking)
- Google analytics (plus extension for retrieving data) <- would need a refactor
- Piwiki
Own Solution
site_tracking table id | url | timestamp | action (page_view, resource_download) |
- Make javascript to make request to ckan to store clicks and page views.
- Add middleware so these requests do not go through pylons and just store data quickly.
comment:5 Changed 2 years ago by toby
TODO
look at
- How do we store this data in CKAN?
- How do we display * Config option ckan.status.enabled = False (by default)