Matomo with CloudFlare


My first thread:

I’m using a self-hosted installation of Matomo to collect statistics from different websites, all of them managed with the CloudFlare CDN. To set up the tracking code using CloudFlare, Matomo redirects to a link. The link contains outdated instructions with the following initial warning:

Please note that all apps for Cloudflare are currently unavailable due to changes at Cloudflare. During this period the Matomo cloud app is not available for installation. CloudFlare is currently planning a new “App experience” to be launched in the future. These instructions will then be updated accordingly.

I see that CloudFlare already allows third-party integrations from its Zaraz section, where Matomo has not yet made its appearance. For the moment I have included the tracking code using the custom HTML tool. I have’nt found any recent information on the forum about this…

  • Has anyone else used this alternative? Do you know if it’s a valid option?
  • Can anyone tell me if Matomo are planning to create the official integration with CloudFlare?


Hello @sdesergi
in the past we used Cloudflare APPs to add the Matomo tracking code to our pages, there was even a Piwik/Matomo APP available.
Sadly Cloudflare APPs is being deprecated by Cloudflare and Zaraz so far only has the Google Analytics integration.
When using the custom HTML tool, do you place the Matomo tracking code in the head or body area of your page?


Hi @Mailman

Correct. According to the documentation we will see some official solution soon, in the meantime, the custom HTML embeds the tracking code just before the </head>. So far this solution seems to be working fine on different sites where I’ve tested it.

I understand that this is what’s desired.

1 Like