matomo-org / matomo-java-tracker

Official Java implementation of the Matomo Tracking HTTP API.
https://matomo-org.github.io/matomo-java-tracker/
BSD 3-Clause "New" or "Revised" License
69 stars 52 forks source link

Enhance Matomo Integration to Read Remote User Attribute #161

Closed dheid closed 10 months ago

dheid commented 10 months ago

Description: Currently, our Matomo Java Tracker lacks the ability to dynamically read the remote user attribute from an HttpServletRequest in Java and set the user id attribute in the Matomo request accordingly. This feature would significantly enhance our tracking capabilities and provide more accurate user insights.

Steps to Reproduce:

  1. Deploy the current version of the Matomo integration.
  2. Observe the lack of functionality to dynamically read the remote user attribute.
  3. Identify scenarios where remote user attribute information is crucial for tracking.

Expected Behavior: The Matomo integration should be extended to retrieve the remote user attribute from the HttpServletRequest in Java and use it to set the user id attribute in the Matomo request.

Additional Context: This enhancement is essential for improving the accuracy of user tracking, especially in scenarios where users are authenticated remotely.

Proposed Solution:

  1. Create a method in the Matomo integration to extract the remote user attribute from the HttpServletRequest.
  2. Set the user id attribute in the Matomo request based on the retrieved remote user attribute.