Visitor is tracked twice if using JS and PHP API on the same page


I have the problem that I have to use the JS and PHP API on my site at the same time.
Which is in general no problem but each visitor is tracked twice.
I already pushing the IP with my PHP code but that’s obviously not enough.
Now I thought I could set a unique VisitorID but it seems that this is not possible in the JS API.

What can I do to get tracked each visitor just once?

Thanks in advance,

please wait for this feature: Accurate User Detection cross devices: User ID (set in JS and all other clients) · Issue #3490 · matomo-org/matomo · GitHub
then you will be able to set the visitor id