diff --git a/MatomoTracker.php b/MatomoTracker.php index f0a9906..ad6b4c3 100644 --- a/MatomoTracker.php +++ b/MatomoTracker.php @@ -2050,3 +2050,12 @@ function Matomo_getUrlTrackGoal($idSite, $idGoal, $revenue = 0.0) return $tracker->getUrlTrackGoal($idGoal, $revenue); } + +/** + * Ensure PiwikTracker class is available as well + * + * @deprecated + */ +if (!class_exists('\PiwikTracker')) { + include_once('./PiwikTracker.php'); +} \ No newline at end of file diff --git a/PiwikTracker.php b/PiwikTracker.php index 4f7b5c8..16b50d9 100644 --- a/PiwikTracker.php +++ b/PiwikTracker.php @@ -11,7 +11,9 @@ * @package MatomoTracker */ -include_once('./MatomoTracker.php'); +if (!class_exists('\MatomoTracker')) { + include_once('./MatomoTracker.php'); +} /** * Helper function to quickly generate the URL to track a page view.