1.41 Usage figures

The Goobi viewer can automatically collect usage figures for individual data sets. The following can be collected:

  • the absolute number of page views (each time a page of a work is called up)

  • unique page views (each view of a page of a work is counted only once per user session)

  • absolute number of downloads (each download of a file)

  • unique downloads (each download of a file is counted only once per user session).

A user session is the session as seen by the Goobi viewer.

The logic is that all calls that open a record are cached in a database. Full days can then be transferred to the Solr search index. Once the data is in the search index, it can either be displayed in a widget or retrieved via the REST API.

The following setting options are available for the configuration:

<statistics enabled="false">
    <crawlerDetection regex=".*[bB]ot.*|.*Yahoo! Slurp.*|.*Feedfetcher-Google.*|.*Apache-HttpClient.*|.*[Ss]pider.*|.*[Cc]rawler.*|.*nagios.*|.*Yandex.*" />

The enabled attribute switches the functionality on or off. If it is active, a widget is also displayed in the sidebar showing the usage figures - provided that data is available.

The regular expression in the element crawlerDetection defines which UserAgents are treated as search engines. These are not counted.

A task is available in the REST API for the regular transfer of usage figures from the database to the Solr search index. This must be triggered regularly, for example via Cron:

## This REST call to write usage statistics from database to Solr
#45 0       * * *   root  curl -s -H "Content-Type: application/json" -H "token:GOOBIVIEWERAPITOKEN" -d '{"type":"INDEX_USAGE_STATISTICS"}' -X POST http://localhost:8080/api/v1/tasks/ 1>/dev/null

The following two REST endpoints are available for querying the usage figures:

Last updated