Skip to content
Ondřej Košarko edited this page Feb 19, 2026 · 9 revisions

Description

The CLARIN-DSpace 5/7.* uses Matomo instead of Google Analytics for tracking statistics. It uses Matomo for tracking:

  • OAI harvesting
  • Bitstream downloads

BE Configuration

Setting up the Matomo

  • You can disable tracking Matomo statistics by setting up the property matomo.track.enabled to false

Properties which must be set in the clarin-dspace.cfg:

  • matomo.track.enabled = true
  • matomo.auth.token = <AUTH_TOKEN> // you will recieve this token after installation the Matomo
  • matomo.site.id = 1
  • matomo.tracker.bitstream.site_id = 1
  • matomo.tracker.oai.site_id = 1
  • matomo.tracker.host.url = # should contain matomo.php (or whatever is the name of your script) not just the hostname; this is interpolated in Spring Bean in core-services.xml
  • matomo.custom.dimension.handle.id = # see below

How to run Matomo

By the Docker:

  • You can use dspace-angular/matomo-w-db.yml
  • Run docker by the command docker compose --env-file $ENVFILE -p dq-d7 -f docker/matomo-w-db.yml up
  • You can override default Matomo Docker envs in you $ENVFILE

Matomo installation

Matomo is listening on the port 8135 (it is defined in the matomo-w-db.yml), so you can reach Matomo page on the e.g., localhost:8135.

  1. Step - next
  2. Step - just check it and if everything is OK - next
  3. You have to set up database user - he's credentials are defined in the matomo-w-db.yml as default values of the properties: MATOMO_DATABASE_USERNAME, MATOMO_DATABASE_PASSWORD, MATOMO_DATABASE_DBNAME image
  4. Creating the tables - next
  5. Super user - it is admin user account which you will use in the Matomo - just define some - next
  6. Set up a Website - Just set up a name and URL for your Matomo - next
  7. JavaScript tracking code - it is just some suggestions - next
  8. Congratulations - next

Trusted host error

You should see page like that: image

This is common issue when you set up Matomo Docker in some special port, check the issue, which is still not fixed: https://github.com/matomo-org/matomo/issues/9549 How to fix:

  1. Connect into Matomo Docker container console: docker exec -it <CONTAINER_ID> /bin/bash
  2. Install nano: Run commands apt update, then apt install nano
  3. Go into config directory: cd /var/www/html/config.
  4. Update config.init.php file by adding there a code which is suggested in the error page, for me it is: image
  5. Refresh Matomo web

Get authorization token for the matomo.auth.token property

  1. Log in with the superuser which you created
  2. Go to settings -> Personal -> Security And you should see such page: image
  3. Scroll down and you should see page section with Auth tokens, just create one and copy it into matomo.auth.token property That's it. NOTE: The Secure use only must be set to No image

FE Configuration

Update mounted config.prod.yml in this way:

matomo:
  hostUrl: http://your.matomo.instance/
  siteId: 1
  dimensionId: 1

nginx example (when Matomo run on http and DSpace on https)

location /repository/matomo/ {
   proxy_pass http://dev-5.pc:8135/;
}

Custom dimension

  1. Go to settings image
  2. Stránky/Custom dimensions image
  3. Configure a new dimension in scope action. Note: the dimension is per site. You should configure it for "theme site" and "bitstream site".
  4. The ID of the new dimension must be added into matomo.custom.dimension.handle.id property in the clarin-dspace.cfg (only for handle dimension) and config.prod.yml

Home


Getting Started

Features

Operations

For Users

Development

Reference


Archive (v5 / stale)

Clone this wiki locally