Is there any other (more direct) way of integrating Matomo with Discourse, instead of using the plugin?
Howâs the cron of root â there should be something like this:
*/12 * * * * /var/www/matomo/console core:archive --url=https://<home-of-matomo>/ > /var/log/apache2/matomo-archieve
(Of course time and logging are personal preferences, and path can and will be different)
But the sad story is this start to be out of scope of Discourse â your forum if sending data and Matomo gets it, is just doesnât show it to you.
Iâm not sure where the cron settings are, in this instance.
Also, as i already have other websites being properly tracked, i would assume that Matomoâs general config is alright.
Yeah, will head over to Matomoâs forum as well.
Thanks for your inputs!
If it can track everything else then the issue is not cron. Or Matomo per se.
What happends if you stop using CSP, letting it only log?
If i disable CSP, iâm getting the same results.
Same logs, no error, no data.
Any idea about this?
No idea, but you can give a try â put the code snippet on header and give a try.
Otherwise I have only one trick left: take a (coffee)break and double and triple check your settings in the component. It is so easy to not see obvious error, like wrong ID or misspelled host.
This should REALLY be added to the main instructions as it seems like a requirement UNLESS one were running Matomo on the same server as Discourse which I would think would be very rare.
Also in my case my Matomo is on another server maintained by another group and Iâve got a URL for it like https://subdomain.domain.com/subfolder/piwik.js and in this case itâs not super clear to me what domain pattern I should use in content_security_policy_script_src so I for the moment am just listing out multiple domains in that setting line by line which I donât feel great about like:
https://subdomain.domain.com
https://subdomain.domain.com/
https://subdomain.domain.com/subfolder
https://subdomain.domain.com/subfolder/
https://subdomain.domain.com/subfolder/piwik.js
https://subdomain.domain.com/subfolder/piwik.php
âŚand then it lets you specify an order with an Arrow option for sorting up and down⌠which is all great - who doesnât like options⌠but in this case when trying to configure something to work probably clear concise direction is most valuable.
The only thing I AM confident of is I did indeed include https:// before my URL which Iâm sure is good as the cert is good, so is the connection, you said it in your post and content_security_policy_script_src instructions denote it under itâs field as wellâŚ
Is anyone super confident to tell me what domain pattern I should really use based on the context I provided above? Thanks in advance.
When I try to add my Matomo host URL (https://analytics.cosmos.coop
) to the content_security_policy_script_src field, I receive the following error:
content_security_policy_script_src: Value must be either âunsafe-evalâ or âwasm-unsafe-evalâ, or in the form â-â where supported hash algorithms are sha256, sha384 or sha512. Ensure that your input is wrapped in single quotation marks.
Any idea what could be wrong here?
Did you wrap the URL in '
?
Discourse now uses a âStrict Dynamicâ CSP, so adding individual URLs is no longer necessary (or possible). More info here:
Iâll remove that section from the OP here. Thanks for the heads-up @madrush
Thank you! Iâve got it working now.
This theme component is working great. Thanks to the contributors!
Is anybody using Goals or other advanced features of Matomo?
Ideas for improvement:
-
User groups (including custom groups) could be tracked through Matomo Custom Variables.
-
Allow to send custom Events from Discourse to Matomo. That would be useful for connecting to Goals.