Matomo offers a PHP composer lib for tracking https://github.com/matomo-org/matomo-php-tracker
This could be used either possibly in a HTTP Component, or could be called asynchronous via JS.
Two interesting topics would be a GDPR safe configuration and extended configurations, which would require additional information for the user.