I enabled Matomo server-side tracking with PHP. It works and the page load speed is much faster than using javascript. However, when enabled, it seems Cloudflare is caching requests, and traffic drops increasingly as more pages are cached.
Assuming you do the serverside tracking inside the page code itself the only thing you can do is to not do any caching on the pages. An alternative way of serverside tracking is requesting a seperate “page” that does the server side tracking and exclude that URL from caching in cloudflare.
The above code I have pasted in the header template (so it’s on all pages).
Based on what you stated, if I tell Cloudflare to ignore MatomoTracker.php and PiwikTracker.php URLs paths. Would that solve the issue? Or is it more complex than adding ignore-cache page rules?