Hi,
We would need to override the behaviour of a Core function and were wondering what is the most elegant way to do it.
Especifically we need to change function getVisitorId in Core/Tracker/Request.php. In this function if a UserId is received by the tracker, a visitorId is created based on the hashed UserId. We need that the visitorId that is used is the one received in the cookie and not based on the UserID.
Therefore we would comment the following lines:
// If User ID is set it takes precedence
$userId = $this->getForcedUserId();
if ($userId) {
$userIdHashed = $this->getUserIdHashed($userId);
$idVisitor = $this->truncateIdAsVisitorId($userIdHashed);
Common::printDebug(“Request will be recorded for this user_id = " . $userId . " (idvisitor = $idVisitor)”);
$found = true;
}
Is there a way to change this without modifying it in the Core and preventing to loose these changes with future Piwik version updates?
Thank you in advance
Jon