Skip to content

Feature/matomo#91

Merged
XanderVertegaal merged 6 commits intodevelopfrom
feature/matomo
Jan 30, 2026
Merged

Feature/matomo#91
XanderVertegaal merged 6 commits intodevelopfrom
feature/matomo

Conversation

@XanderVertegaal
Copy link
Copy Markdown
Contributor

@XanderVertegaal XanderVertegaal commented Jan 27, 2026

Closes #10

This PR adds Matomo to the application to track page visits. The application has been deployed to the ACC server but I'm not sure it's working correctly. I can see Matomo requests going out (the 204 - No Content status code is expected) but I see no traffic in the dashboard. Maybe this is because acceptDoNotTrack is set to true and every browser I have requests DNT?

(FireFox always sends DNT: 1 as a Request Header, and you cannot turn it off anymore, cf. this article.

Would you be able to test this?

Good to know: for local testing of this and other applications, I have created this repo that lets you build a local Matomo instance (in Docker). I did manage to see stats in my local Matomo instance, but I had acceptDoNotTrack set to false there.

I am also updating the RSL-Info docs on Matomo with lessons learned in this PR.

@XanderVertegaal XanderVertegaal marked this pull request as ready for review January 28, 2026 17:18
import { MatomoConfiguration } from "ngx-matomo-client";


export interface Environment {
Copy link
Copy Markdown
Contributor Author

@XanderVertegaal XanderVertegaal Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to validate the environment object. Else TypeScript does not know what matomo is and requires you to do a lot of cumbersome checks along the lines of if ('matomo' in environment && typeof environment.matomo === 'object' && 'siteId' in environment.matomo && typeof environment.matomo.siteId === 'string') { ...

Now we not only know that environment could contain a matomo key, but also that it will have the shape expected by ngx-matomo-client.

Comment thread frontend/angular.json
},
"configurations": {
"production": {
"fileReplacements": [
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was done automatically, but apparently not. 🙄

version,
sourceUrl,
};
matomo: {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file gets overridden by this file that I've added to the development repository.

Copy link
Copy Markdown
Contributor

@tijmenbaarda tijmenbaarda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no experience with Matomo in Angular (just in plain Django), but it seems to be working correctly! Matomo only shows data of a day before, maybe that was why you were not seeing any visits?

@tijmenbaarda
Copy link
Copy Markdown
Contributor

What I understand from the Firefox article is that DNT is not supported anymore at all and not send either, since the header is deprectated. But I see indeed that my Firefox (v. 140) is still putting it in the header...

@XanderVertegaal
Copy link
Copy Markdown
Contributor Author

Interesting! In my local Matomo instance I saw near-live updates, but maybe they are configured differently. Glad to see that it works!

@XanderVertegaal XanderVertegaal merged commit a8a4955 into develop Jan 30, 2026
1 check passed
@XanderVertegaal XanderVertegaal deleted the feature/matomo branch January 30, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monitoring

2 participants