From 7fddbd00e21edaf6a533220ab3aab636d5d77d3a Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Wed, 20 Nov 2024 16:30:52 +0100 Subject: [PATCH] Send custom dimension also in oai tracker --- .../dspace/app/statistics/clarin/ClarinMatomoOAITracker.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/clarin/ClarinMatomoOAITracker.java b/dspace-api/src/main/java/org/dspace/app/statistics/clarin/ClarinMatomoOAITracker.java index c6240b4da8a6..5e0ca5703b52 100644 --- a/dspace-api/src/main/java/org/dspace/app/statistics/clarin/ClarinMatomoOAITracker.java +++ b/dspace-api/src/main/java/org/dspace/app/statistics/clarin/ClarinMatomoOAITracker.java @@ -7,6 +7,7 @@ */ package org.dspace.app.statistics.clarin; +import java.util.LinkedHashMap; import java.util.Objects; import javax.servlet.http.HttpServletRequest; @@ -56,6 +57,10 @@ protected void preTrack(Context context, MatomoRequest matomoRequest, Item item, log.debug("Logging to site " + matomoRequest.getSiteId()); try { matomoRequest.setPageCustomVariable(new CustomVariable("source", "oai"), 1); + // Add the Item handle into the request as a custom dimension + LinkedHashMap handleDimension = new LinkedHashMap<>(); + handleDimension.put(11L, item.getHandle()); + matomoRequest.setDimensions(handleDimension); } catch (MatomoException e) { log.error(e); }