this pr adds the function getGlobalVisitorId() to the tracker js, which returns the visitorId stored in the 3rd party cookie (_pk_uid)
Note: this function will only work correctly, when the Matomo third party cookie is bound to the same domain, for example:
www.example.com -> Content
matomo.example.com -> Matomo
cookie domain: example.com
This could be improved by adding an API call which returns the value (visitorId) of the third party cookie. But I am unsure whether this is a good idea or not. If you are interested, I can adjust my pr.
If this gets accepted, I can add getGlobalVisitorId() also to matomo-php-tracker, if you are intersted.