Getting PHP errors after Matomo upgrade

I upgraded Matomo to the recent version today. After the ugrade, I get the following PHP errors:

PHP Fatal error:  Class 'MatomoTracker' not found in ****/PiwikTracker.php on line 50

I am using the following code to track pageviews:

// -- Matomo Tracking API init -- 
require_once (__DIR__ . '***PiwikTracker.php');
PiwikTracker::$URL = ***;
    $tracker = new PiwikTracker(***);


Before the upgrade it was working fine. I downloaded the latest PiwikTracker.php as mentioned in, but then also it did not work. Any help will be much appreciated.

I am also unable to find the class definition of MatomoTracker. I can see class PiwikTracker is defined within matomo-php-tracker/PiwikTracker.php. Can you please let me know the path where the MatomoTracker class is defined?

I could find a workaround for this problem. I used the old PiwikTracker.php that was mentioned in instead of the new one and changed the path of PiwikTracker.php manually (to …/matomo-php-tracker/Piwiktracker.php)inside that file. That could resolve the issue for the time being.