CookieConsent v3: Problems with script management with data-category

Scripts were not executed when the cookie category was selected.

I have built a cookie banner on two of our websites with the help of the “CookieConsent-Script“.

Depending on the selection of categories, certain scripts should be executed, e.g. for Matomo or Google Analytics.

However, this did not work. I marked the scripts with the “data-category” attribute and also set the “type” to “text/plain”, but the selection was not recognised and the script was not executed.

The solution was quite simple in the end. It is important that the configuration script or the cookie consent script is only executed at the end or after the scripts. Then it worked.

Leave a Reply

Your email address will not be published. Required fields are marked *