I am trying to implement server side tracking and can successfully see page views within Matomo, however, each visitor is showing the servers IP address.
After reading the docs, and to get around this, I am settings setTokenAuth, but I then lose all tracking. As soon as I comment out the setTokenAuth line, it all starts again.
Where could I be going wrong?
$matomoTracker = new MatomoTracker($matomoSiteId, $matomoUrl );
$matomoTracker->setRequestTimeout(2);
$matomoTracker->setTokenAuth($authToken);
$matomoTracker->setRequestMethodNonBulk('POST');
if (is_user_logged_in()) {
$matomoTracker->setUserId($display_name);
}
$matomoTracker->setIp($connecting_ip);
$matomoTracker->doTrackPageView( $page_title );
(The variables all return the correct values)
1 post - 1 participant