Problem/Motivation

We have cookies + matomo modules installed and configured the cookies matomo in a way, that the cosent is required (like the default)

The problem is, that the matoma script + matomo cookies are included even before the consent is given.

Steps to reproduce

Install Matomo
Install Cookies
Install Cookies Matomo

- configure matomo to require consent
- open the page and check, that the matomo script is included even before consent.

Proposed resolution

I don't understand the code fully, but I would say the cookies_matomo_page_attachments function is already trying to remove the matomo library. question is, why it is not happening.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Schoenef created an issue. See original summary.

anybody’s picture

@Schoenef Thanks! Are you a developer? If yes, could you perhaps have a deeper look at the actual values provided in cookies_matomo_page_attachments vs. the handled keys?

I guess that would be helpful. Perhaps there was a change in the matomo module?

Once we know the issue, we should add a test that if consent is required, the scripts are never present!

anybody’s picture

Assigned: Unassigned » grevil
schoenef’s picture

Ok, I'll have a look on monday :)

anybody’s picture

@Schoenef ping :) Wednesday :P

schoenef’s picture

Jea, tell me about it ;) - so I looked again into the issue, but it magically disappeared...

Looks like it works exactly as it should, I think we can close this one.

Thx a lot!

anybody’s picture

Status: Active » Closed (cannot reproduce)

Thx @Schoenef whao, no idea, perhaps it was fixed by one of the latest updates. Thank you!
Feel free to reopen with details, if it should happen again.

steffenr’s picture

We have a similar problem. But in our case this is only happening on live/ staging system.
Our local ddev environment is handling the consent/ rewriting done via cookies_matomo_page_attachments correctly.

On our stage/ prod the cookies_matomo_page_attachments is not working for no reason.
We also implemented a custom cookies service for matomo_tag_manager, which is working/ rewritten correctly using the same logic as cookies_matomo_page_attachments.

anybody’s picture

Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

Should you have any ideas for the reasons, or even better a fix, please let us know.

steffenr’s picture

@anybody: I do so. I'll have a closer look tomorrow and will run some tests on other machines. Hope we can reproduce the bug on another local environment to find a fix..

anybody’s picture

Smells like could be kind of a caching issue...

steffenr’s picture

Even after clearing caches the problem still persists.
It's kind of strange, since our custom cookie plugin is working without any problems and the hook_page_attachments is rewriting the code correctly.

grevil’s picture

Assigned: grevil » Unassigned