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.*|.*monitoring-plugins.*|.*node-fetch.*|.*Munin.*|.*SearchHelper.*|.*Qwantify.*|.*feedparser.*|.*Prefetch Proxy.*|.*internal dummy connection.*|.*Go-http-client.*|.*facebookexternalhit.*|^.?$|.*Dataprovider.com.*|.*TYPO3.*|.*python.*|.*curl.*|.*LinkAnalyser.*|.*GuzzleHttp.*|.*Spawning-AI.*|.*Iframely.*|.*ApacheBench.*|.*deadlinkchecker.*|.*Fingerprinter.*|.*Riddler.*|.*Java-http.*" />
</statistics>

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.

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

Get usage statistics for a single day

get
Path parameters
datestringRequired

date to observe, in format yyyy-mm-dd

Query parameters
recordFilterQuerystringOptional

additional SOLR query to filter records which should be counted. Only requests to records matching the query will be counted

formatstringOptional

the format in which to return the data. May be json, text or csv. Default is json

Responses
default
default response
get
GET /api/v1/statistics/usage/{date} HTTP/1.1
Host: viewer.goobi.io
Accept: */*
default

default response

No content

Get a list of usage statistics for a time frame

get
Path parameters
startDatestringRequired

first date to observer, in format yyyy-mm-dd

endDatestringRequired

last date to observer, in format yyyy-mm-dd

Query parameters
recordFilterQuerystringOptional

additional SOLR query to filter records which should be counted. Only requests to records matching the query will be counted

formatstringOptional

the format in which to return the data. May be json, text or csv. Default is json

stepinteger · int32Optional

the number of time units (default: days) each statistics should span

stepUnitstringOptional

The time unit to use for 'step' paramter. May be years, months, weeks or days

Responses
default
default response
get
GET /api/v1/statistics/usage/{startDate}/{endDate} HTTP/1.1
Host: viewer.goobi.io
Accept: */*
default

default response

No content

Last updated

Was this helpful?