# Matomo Analytics

**URL:** https://meta.discourse.org/t/matomo-analytics/33090
**Category:** Theme component
**Tags:** official, matomo-analytics
**Created:** [10 september 2015 om 10:18 UTC](https://meta.discourse.org/t/matomo-analytics/33090 "2015-09-10T10:18:13Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [25 januari 2020 om 22:39 UTC](https://meta.discourse.org/t/matomo-analytics/33090/50 "2020-01-25T22:39:08Z")

</div>

I don’t use them in my installation.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [27 januari 2020 om 12:51 UTC](https://meta.discourse.org/t/matomo-analytics/33090/53 "2020-01-27T12:51:47Z")

</div>

> [@chrismade](#):
>
> maybe someone can help me in how to trouble shoot such issues

A few random thoughts:

- Best to test from a private/incognito session where you’re not signed in.
- Make sure your browser is not set to “do not track”.
- Check the network tab of your browser’s developer tools console and make sure the request is making it to your Matomo stats site.
- If you see errors in the console it’s probably because you need to set up CSP and add your Matomo site; there is a Discourse site setting for this.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [27 februari 2020 om 13:53 UTC](https://meta.discourse.org/t/matomo-analytics/33090/54 "2020-02-27T13:53:27Z")

</div>

For the many open source communities using Discourse that might see this and want to avoid things like Google, know that Matomo is offering free hosted installations for such projects if you don’t have the infrastructure or skills to install and run it yourself:

> **[Is there a free offer or discount for Free software projects?](https://forum.matomo.org/t/is-there-a-free-offer-or-discount-for-free-software-projects/35412/2)**
>
> Yes we do offer either a free account or a discount! Please reach out by email to learn the details. Thanks

---

<div class="post-metadata">

### Author: ![GinNTonic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ginntonic/32/176707_2.png) [@GinNTonic](https://meta.discourse.org/u/GinNTonic)
#### Post date: [13 april 2020 om 16:57 UTC](https://meta.discourse.org/t/matomo-analytics/33090/55 "2020-04-13T16:57:55Z")

</div>

I have a problem with a ‘secondsite’ setup (through multisite.yml) On the original/main site this works fine, on the second site it does not. Javascripts are loaded through a pull CDN for both sites. Could that be a problem?

---

<div class="post-metadata">

### Author: ![SouperC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/souperc/32/62875_2.png) [@SouperC](https://meta.discourse.org/u/SouperC)
#### Post date: [23 april 2020 om 03:47 UTC](https://meta.discourse.org/t/matomo-analytics/33090/56 "2020-04-23T03:47:58Z")

</div>

Matomo has always worked well for me, so this topic made me check how I have it configured to load…  
Turns out I actually have it being loaded via a cloudflare “app”

---

<div class="post-metadata">

### Author: ![AquaL1te](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aqual1te/32/201966_2.png) [@AquaL1te](https://meta.discourse.org/u/AquaL1te)
#### Post date: [27 juni 2022 om 14:18 UTC](https://meta.discourse.org/t/matomo-analytics/33090/61 "2022-06-27T14:18:35Z")

</div>

A few features are missing in this theme component. Such as do-not-track and cookie settings. To be GDPR compliant without cookie consent it’s needed to make sure tracking cookies are disabled and people have the means to opt-out tracking.

For that the following parts need to be included:

```plaintext
  _paq.push(['setDoNotTrack', true]);
  _paq.push(['disableCookies']);

```

Or is this plugin working in a different way? Just assuming since I don’t see it here and also not when I search for `donottrack` in that repo.

[https://github.com/discourse/discourse-matomo-analytics/blob/main/common/head\_tag.html](https://github.com/discourse/discourse-matomo-analytics/blob/main/common/head_tag.html)

The Matomo web interface also lets you add these 2 paq lines easily. Maybe add these options to the Discourse plugin for easy configuration?

 ![Screenshot_20220628-060312](https://global.discourse-cdn.com/meta/original/4X/1/d/a/1dadc32fa716af58bcc6510fe9710aa41c046ac5.png)

* * *

Will test this commit, if it works well I’ll submit a PR.

> <https://github.com/kees-closed/discourse-matomo-analytics/blob/main/common/head_tag.html>

---

<div class="post-metadata">

### Author: ![AquaL1te](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aqual1te/32/201966_2.png) [@AquaL1te](https://meta.discourse.org/u/AquaL1te)
#### Post date: [17 juli 2022 om 15:08 UTC](https://meta.discourse.org/t/matomo-analytics/33090/62 "2022-07-17T15:08:56Z")

</div>

So far it has been working like a charm! But no word yet from the devs about a merge or other feedback.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [3 oktober 2022 om 15:09 UTC](https://meta.discourse.org/t/matomo-analytics/33090/65 "2022-10-03T15:09:46Z")

</div>

Sorry about the very long delay here, I just reviewed the PR and left a comment.

PR looks good, but I would prefer the settings to be default off so that existing users of the theme component don’t get any undesired changes automatically.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [4 oktober 2022 om 13:26 UTC](https://meta.discourse.org/t/matomo-analytics/33090/66 "2022-10-04T13:26:50Z")

</div>

The PR above has now been merged (thanks @AquaL1te), you can now enable `do_not_track` and `disableCookies` in the component settings.

---

<div class="post-metadata">

### Author: ![AquaL1te](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aqual1te/32/201966_2.png) [@AquaL1te](https://meta.discourse.org/u/AquaL1te)
#### Post date: [4 oktober 2022 om 14:35 UTC](https://meta.discourse.org/t/matomo-analytics/33090/67 "2022-10-04T14:35:15Z")

</div>

Awesome! This small addition gives admins more control over what data is collected and also helps EU admins to comply with the GDPR better 🎉 Thanks for checking and merging.

---

<div class="post-metadata">

### Author: ![shrey](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@shrey](https://meta.discourse.org/u/shrey)
#### Post date: [30 november 2022 om 07:19 UTC](https://meta.discourse.org/t/matomo-analytics/33090/68 "2022-11-30T07:19:30Z")

</div>

This theme-component doesn’t seem to work for me, unfortunately. Could use some help with it.

I installed the component and then added the necessary info (URL & ID) of my Matomo installation.

But Matomo is yet to register a single visit from the Forum.

In the browser dev console, i can see 2 types of requests to the Matomo instllation:

1. GET [https://matomo-url/piwik.js](https://matomo-url/piwik.js) (Result 200)
2. POST [https://matomo-url/piwik.php?](https://matomo-url/piwik.php?) (Result 204)

Also, i have added my matomo-url to the content-security-policy settings.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [30 november 2022 om 07:39 UTC](https://meta.discourse.org/t/matomo-analytics/33090/69 "2022-11-30T07:39:34Z")

</div>

I can’t help you, sorry, because all I can say is Matomo works for me just fine. I’m meaning the issue lays somewhere else then.

Are you totally sure Matomo can archieve results — cron is working or your settings allow it when visiting on Matomo?

---

<div class="post-metadata">

### Author: ![AquaL1te](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aqual1te/32/201966_2.png) [@AquaL1te](https://meta.discourse.org/u/AquaL1te)
#### Post date: [30 november 2022 om 08:08 UTC](https://meta.discourse.org/t/matomo-analytics/33090/70 "2022-11-30T08:08:36Z")

</div>

Maybe you can see some hints in your browser’s error console?

---

<div class="post-metadata">

### Author: ![shrey](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@shrey](https://meta.discourse.org/u/shrey)
#### Post date: [30 november 2022 om 08:20 UTC](https://meta.discourse.org/t/matomo-analytics/33090/71 "2022-11-30T08:20:53Z")

</div>

@AquaL1te Nope, there are no errors in the console

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [30 november 2022 om 08:33 UTC](https://meta.discourse.org/t/matomo-analytics/33090/72 "2022-11-30T08:33:33Z")

</div>

There is never. Matomo just doesn’t work that way. Or Discourse.

99 times out of hundred it happends because of cron. Matomo gets data but can’t process it to metrics, because there is nothing, like cron, that triggers it. And Matomo doesn’t tell you that.

Are you hosting Matomo by yourself?

---

<div class="post-metadata">

### Author: ![shrey](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@shrey](https://meta.discourse.org/u/shrey)
#### Post date: [30 november 2022 om 08:34 UTC](https://meta.discourse.org/t/matomo-analytics/33090/73 "2022-11-30T08:34:27Z")

</div>

I’m self-hosting Matomo, via Cloudron.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [30 november 2022 om 08:36 UTC](https://meta.discourse.org/t/matomo-analytics/33090/74 "2022-11-30T08:36:19Z")

</div>

Then there is the hundredth option: something is blocking datastream to your Matomo.

---

<div class="post-metadata">

### Author: ![shrey](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@shrey](https://meta.discourse.org/u/shrey)
#### Post date: [30 november 2022 om 08:41 UTC](https://meta.discourse.org/t/matomo-analytics/33090/75 "2022-11-30T08:41:54Z")

</div>

These are the (masked) logs from Cloudron/Matomo:

```plaintext
Nov 30 14:08:02 49.43.155.192 - - [30/Nov/2022:08:38:02 +0000] "GET /piwik.js HTTP/1.1" 200 21541 " ****" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
Nov 30 14:08:03 49.43.155.192 - - [30/Nov/2022:08:38:03 +0000] "POST /piwik.php?action_name= ****HTTP/1.1" 204 - "****" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
Nov 30 14:08:03 172.18.0.1 - - [30/Nov/2022:08:38:03 +0000] "POST /piwik.php?action_name= ****HTTP/1.1" 204 231 "****" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
Nov 30 14:08:08 49.43.155.192 - - [30/Nov/2022:08:38:08 +0000] "POST /piwik.php?action_name= ****HTTP/1.1" 204 - "****" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
Nov 30 14:08:08 172.18.0.1 - - [30/Nov/2022:08:38:08 +0000] "POST /piwik.php?action_name= ****HTTP/1.1" 204 231 "****" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"

```

---

<div class="post-metadata">

### Author: ![shrey](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@shrey](https://meta.discourse.org/u/shrey)
#### Post date: [30 november 2022 om 08:45 UTC](https://meta.discourse.org/t/matomo-analytics/33090/76 "2022-11-30T08:45:04Z")

</div>

Apparently, the requests are being received by Matomo just fine.

---

<div class="post-metadata">

### Author: ![shrey](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@shrey](https://meta.discourse.org/u/shrey)
#### Post date: [30 november 2022 om 08:46 UTC](https://meta.discourse.org/t/matomo-analytics/33090/77 "2022-11-30T08:46:30Z")

</div>

In Cloudron/Matomo:

```plaintext
Nov 30 14:15:13 172.18.0.1 - - [30/Nov/2022:08:45:13 +0000] "POST /piwik.php?action_name=***
Nov 30 14:15:13 49.43.155.192 - - [30/Nov/2022:08:45:13 +0000] "POST /piwik.php?action_name=***

```

[Previous page](https://meta.discourse.org/t/matomo-analytics/33090.md?page=1)

[Next page](https://meta.discourse.org/t/matomo-analytics/33090.md?page=3)
