Ticket #937 (new enhancement) — at Version 2

Opened 3 years ago

Last modified 3 years ago

Record download stats for resources (extension)

Reported by: rgrp Owned by: rgrp
Priority: major Milestone: ckan-v1.4-sprint-5
Component: ckan Keywords: extension contributor simple js
Cc: Repository: ckan
Theme: none

Description (last modified by rgrp) (diff)

As a User (especially as a Package Owner/Maintainer?) I want to know how many times a resource has been downloaded (and when).

So let's record download stats (as in clicks on the link for a resource).

Implementation

Old Spec (do it in CKAN)

  • Record info of form: resource id (or url?), timestamp
  • Do this via javascript capturing of onclick event talking to an api
  • API: /api/resource/{id}/download
    • POST to increment (how do we stop spamming -- could use a nonce setup with a random string set on each page load for the js)
    • GET to get data back { total: X, day_count: [ [yyyy-mm-dd, count], ... ] }

Questions

  • Do we record ip addresses (to handle de-botting etc)?
  • Do we count preview clicks as well?

Change History

comment:1 Changed 3 years ago by sebbacon

Could consider using third-party analytics tracking here, which will also give referrer etc data for free?

Would probably be bes provided in the form of optional piwik or google analytics integration. Being able to say in the UI how many downloads there have been would need piwik.

comment:2 Changed 3 years ago by rgrp

  • Keywords extension contributor simple js added
  • Owner set to rgrp
  • Description modified (diff)
  • Milestone changed from ckan-v1.4 to ckan-v1.4-sprint-2
Note: See TracTickets for help on using tickets.