Skip to content
Ondrej Kosarko edited this page Dec 6, 2024 · 2 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

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

You must set Matomo API URL in the Spring Bean - update the file core-services.xml, check: https://github.com/dataquest-dev/DSpace/pull/182/files#diff-39dd93aab2debd41b09d0508a15179c528a2a71a07b47f692ea5aec8c256935eR157

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.

Custom dimension

  1. Go to settings image
  2. Stránky/Custom dimensions image
  3. Configure a new dimension
  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)
Clone this wiki locally