Quantcast
Channel: Support & Bugs - Matomo forums
Viewing all articles
Browse latest Browse all 5981

Visitors are not recognized 'same' when sending TrackingData using the PHP Http Api + cookiless tracking

$
0
0

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 :heavy_check_mark:.

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 :x:. 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

Read full topic


Viewing all articles
Browse latest Browse all 5981

Trending Articles