Class MatomoRequestCookieIdentifierEnricher

java.lang.Object
org.dspace.matomo.factory.MatomoRequestCookieIdentifierEnricher
All Implemented Interfaces:
MatomoRequestDetailsEnricher

public class MatomoRequestCookieIdentifierEnricher extends Object implements MatomoRequestDetailsEnricher
Enricher that extracts any _pk_id cookie sent inside the request to track the same id used to track interaction on the angular side.
The cookie will have a similar format: _pk_id.1.1fff=3225aebdb98b13f9.1740076196.
Where only the first 16 hexadecimal characters represents the id for Matomo.
Author:
Vincenzo Mecca (vins01-4science - vincenzo.mecca at 4science.com)
  • Constructor Details

    • MatomoRequestCookieIdentifierEnricher

      public MatomoRequestCookieIdentifierEnricher()
  • Method Details

    • enrich

      public MatomoRequestDetails enrich(UsageEvent usageEvent, MatomoRequestDetails matomoRequestDetails)
      Description copied from interface: MatomoRequestDetailsEnricher
      Enriches the provided MatomoRequestDetails with additional parameters based on the UsageEvent.
      Specified by:
      enrich in interface MatomoRequestDetailsEnricher
      Parameters:
      usageEvent - The usage event containing information to enrich the request details
      matomoRequestDetails - The request details object to be enriched with additional parameters
      Returns:
      The enriched MatomoRequestDetails object
    • hasCookie

      public static boolean hasCookie(jakarta.servlet.http.Cookie[] cookies)
    • getCookie

      public static Optional<String> getCookie(jakarta.servlet.http.Cookie[] cookies)