You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visits should be sent using a background job when possible.
Make sure there's a reasonable timeout. If the matomo instance goes away, it should not have a big impact on visitors, specially when not using an async runtime.
Make dev env more straightforward. Right now you need to go over the installation process and generate some info manually.
$matomoToken = '...'; // Must be admin/superuser$matomoSiteId = '3';
$matomoUrl = 'http://shlink_matomo';
// Create a new MatomoTracker on every request, because it infers request info during construction$tracker = newMatomoTracker($matomoSiteId, $matomoUrl);
$tracker->setTokenAuth($matomoToken);
$tracker->disableBulkTracking(); // We don't want to bulk send, as every request to Shlink will create a new tracker$tracker
->setUrl('http://localhost:8800/foo') // Set absolute short URLfor the visit to be tracked
->setCity('Zaragoza')
->setCountry('Spain')
->setRegion('Aragón')
->setLatitude(41.656840)
->setLongitude(-0.879420)
->setIp('1.2.3.4') // Set not obfuscated, as matomo handles obfuscation on itself
->setUserAgent('bar')
->setRequestMethodNonBulk('POST') // Ensure params are not sent in the URL, for security reasons
->setCustomTrackingParameter('type', VisitType::INVALID_SHORT_URL->value)
->setCustomTrackingParameter('orphan', 'true') // Set only for orphan visits?
->doTrackPageView('http://localhost:8800/foo'); // Use same short URL as action
https://github.com/matomo-org/matomo-php-tracker
FAQ:
This can make visits in Shlink and matomo not match, so it should be documented how it works, and how to change it.
TODO
Nice to have (for future versions):
MATOMO_TIMEOUT
)The text was updated successfully, but these errors were encountered: