Hello,
I have the same problem, and have investigated a little.
The problem is that when setting the API PHP to connect the plugin to Matomo, the CSP policy of the instance of Matomo is applied to the whole WordPress website. So it overrides other CSP policies as the strictest policy is applied in this case.
In my case, I have a lot of things that stopped working when connecting this plugin to Matomo (all iframes, but also some fonts, etc.). In fact, even the Matomo script was blocked !
So if I connect the plugin to Matomo, a lots of things stop working and I don’t have statistics either as it blocked itself…
Thread Starter
joben
(@joben)
Thanks for the info.
Is WP-Matomo necessary for Matomo to work on-prem?
WP-Matomo is mentioned in the official Matomo documentation, and Matomo are actively selling components for the on-prem version on their website. Here, WP-matomo is mentioned: https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-wordpress/
We might need to abandon Matomo and find some other tool. I will check with their support as well.
Thread Starter
joben
(@joben)
I got in touch with the Matomo support and I followed their advice:
Thanks for reaching out.
It is not absolutely necessary needed to use the WP-Matomo plugin for tracking, if you have access to your WordPress back end in the head of your website pages, you can add the JavaScript tracking code to enable tracking manually.
Look forward to hearing back.
Have a great day ahead,
Works great.
I just wonder why you are using the PHP API if this is causing problems? You can just switch to the HTTP API, so no Matomo PHP is loaded “within” your WordPress instance.
The plugin is intended to show your Matomo stats within your WordPress dashboard, adding the tracking code is just an extra functionality so you do not have to modify your WordPress’ or Theme’s header or footer code.