Status code 204 for matomo.php tracking file

Normally, If we visit a website and go to inspect element section of the browser and then go to network, we see two requests going to Matomo server with status code 200 but In my case one request i.e. matomo.php is showing 204 status code and data is not being tracked on Matomo.

Anyone please have a look at the following screenshot and help to fix the issue. Thanks!

I am using Matomo 4.5 and here is the link for my website.

@Lukas @philipp1

I don’t see where the issue is.

204 No Content is the correct status code for the matomo.php request as there is no content in the response.

If you want to know why data is not stored, you can temporarily enable
https://developer.matomo.org/api-reference/tracking-api#debugging-the-tracker

Thanks @Lukas , I have seen an issue under diagnostic tab in system check

The issue is Recommended private directory is accessible which should not be. The screenshots are attached.

Can this issue cause 204 status code and by fixing this issue, the tracking issue will be solved?


This is completely unrelated and means that there URLs are accessible from the internet which they shouldn’t be (any you should check your webserver to see why)

Again, a 204 status code is the correct one for Matomo to respond with

But tracking is not being done on Matomo server. I am not seeing any new traffic or visitors activities on the Matomo dashboard. I access my website, there is no error in console tab of the browser and 204 status code in network tab but still zero in Real time visitor count and no activity is being tracked on Matomo server. I am using on primse version of Matomo 4.5.0

That’s why you can enable tracking debugging and then Matomo will respond with a verbose log why your data is not stored instead of the 204

Sure, I am just going to enable logs. But can you also have a look at following issue? I need your help there urgently. Thank you so much!

If you prefer getting HTTP 200 instead of HTTP 204, use an image instead of nothing in the HTTP API. See there for the send_image parameter.

For the tracking issue, maybe your browser sends a DNT HTTP header parameter, then Matomo does not track it. Try with another browser and/or configure this in Matomo:
https://fr.matomo.org/docs/privacy-how-to/#step-4-respect-donottrack-preference