Hi there,
I’ve played around with matomo and it’s API now for couple of days and run into this problem:
With cookie-based tracking, retrieving the visitorId using the Http API is straight forward and works fine:
$tracker = new MatomoTracker();
$visitorId = $tracker->getVisitorId();
→ The MatomoTracker::__constructor inits MatomoTracker::cookieVisitorId with the id found in the cookie and calling $tracker->getVisitorId() returns this very fitting id. So my Tracks send via PHP will be aligned with the other visitors data inside Matomo
.
As i understood, cookieless tracking uses other metrics, than a primitive cookie, to determine a consistent visitorId to buildup a visitors profile. Viewing the path taken by a user in Matomo Reports who is not tracked using cookies i can confirm this works quite good! Also the user has obtained a visitorId!
But, and here comes the problem
. When Cookieless tracking is enabled and MatomoTracker::__construct is doing it’s thing, no cookie is discovered and MatomoTracker::cookieVisitorId remains uninitiated (false).
Calling $tracker->getVisitorId() now returns MatomoTracker::randomVisitorId (the only MatomoTracker::*VisitorId filled). This is, as the name suggest, always a different one and eventually, every report send with the $tracker can’t be aligend with the existing visitor profile already inside Matomo!
I feel the data contained in the query rendered by MatomoTracker is wrong.
Oh yes, I’ve read all the docs I found carefully. So this is either not (yet) implemented or something goes wrong.
1 post - 1 participant