Wishlist: add a link tracker for the course materials module

Bug #1895695 reported by Jane Sandberg
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
New
Wishlist
Unassigned

Bug Description

Desired behavior: When a user clicks on a link to a course material (such as a library ebook or an openly licensed textbook), Evergreen ILS must store certain information about this click in a database table, and it must be available in the reports module.

* Date/time
* The ID of the bib record that included the link
* The IDs of the courses that the bib record is associated with at the time of the click

It should not track the user ID or any other information that could be used to easily identify the user.

Motivation: Librarians can use these statistics when talking with faculty about low-cost course materials (like Open Educational Resources and library ebooks).

Revision history for this message
Beth Willis (willis-a) wrote :

In general, our libraries want the ability to provide circulation statistics for reserve materials to faculty. With many more reserves materials now (and likely in future to be) in digital format, these statistics will be important to capture.

Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
tags: added: pullrequest
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Here is a branch to implement this feature (top 4 commits): https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp1895695-link-tracker

Here are some ideas about how to test this:

1. Set the ``opac.eresources.link_click_tracking`` global flag to true.
2. Restart memcached and apache HTTP server.
3. In the public catalog, click on some eresource links (record 239 has one in the concerto data set)
4. Run a report on the Eresource Link Click reporter source, and make sure that your clicks show up in the data.
5. Attach some eresources to some courses. Repeat steps 3 and 4. Try running a report with the Eresource Link Click Course link too.
6. In the database, add several entries to the action.eresource_link_click with various dates. Run the delete_old_eresource_link_clicks.pl script and confirm that it deletes the correct dates

Thanks in advance for your feedback!

Changed in evergreen:
assignee: nobody → Terran McCanna (tmccanna)
Andrea Neiman (aneiman)
Changed in evergreen:
milestone: none → 3.13-beta
Revision history for this message
Mike Rylander (mrylander) wrote :

I see Terran is looking at this, but I saw thought I would offer some feedback about the general structure of the code.

With some notable exceptions, the OpenILS::Application Perl module namespace is generally reserved for modules (and module groups) that provide an OpenSRF application implementation. I would recommend the contents of the OpenILS::Application::EResourceLinkClick package be moved into the OpenILS::WWW namespace, and not inherit from OpenILS::Application, since it's not meant to register OpenSRF methods. In fact, as it doesn't have any overlapping sub names with the parallel OpenILS::WWW::EResourceLinkClick module, it could be absorbed there quite nicely, I think.

A couple schema notes:

  - The IDL says "clicked_at" is required, but it has a DEFAULT. This may be debatable, still, but I would lean towards not marking anything that has a database default.
  - The course column on action.eresource_link_click_course is NOT NULL and is meant to point to a course id, but does not have an FKEY. I would recommend the reverse of that -- allow it to be NULL, add the FKEY, and if we want to be able to remove the course, set the FKEY to ON UPDATE CASCADE ON DELETE SET NULL.

Otherwise, it all looks good from a code read.

Revision history for this message
Terran McCanna (tmccanna) wrote :

Sorry, I forgot I had that assigned to myself. Removed my name for now!

Changed in evergreen:
assignee: Terran McCanna (tmccanna) → nobody
Changed in evergreen:
milestone: 3.13-beta → 3.next
milestone: 3.next → 3.13-rc
milestone: 3.13-rc → 3.next
Revision history for this message
Terran McCanna (tmccanna) wrote :

Removing pullrequest as per comment #3

tags: added: needswork
tags: removed: pullrequest
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for the review and the information, Mike! I've rebased and pushed an additional commit to user/sandbergja/lp1895695-link-tracker to incorporate your feedback (this feature is 5 commits now).

* Good to know about the OpenILS::Application namespace. I added a little README to the lib/OpenILS/Application directory with the background you provided. I like the separation of concerns of two files (one handles http requests, the other validates and persists data), so I kept them separate and threw the validator/persistor into OpenILS::WWW::EResourceLinkClick::Click.pm.
* I removed the required flag from clicked_at in the IDL.
* Good point about action.eresource_link_click_course -- I've made those changes.

For anybody installing this feature, a note that it requires the following to install:
* a new CPAN dependency, so `make -f Open-ILS/src/extras/Makefile.install <osname>` is required (or just cpan i Duadua)
* new apache httpd configs, so `cp Open-ILS/examples/apache_24/eg_vhost_24.conf /etc/apache2/eg_vhost.conf` is required
* fm_IDL changes
* a database migration
* make and make install
* restarting opensrf, apache httpd, and (after you update the global flag) memcached

Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
tags: added: pullrequest
removed: needswork
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.