I'm attempting to switch from cookiepro to this module on an existing site. I uninstalled the old module, installed this one and added the script id. I used the cookiepro CDN as we had been using that before.
The banner pops up as usual, but no matter what I select the banner reappears on each page load. The OptanonConsent and OptanonAlertBoxClosed cookies are not created, hence why the banner keeps popping up. No browser settings were changed, so I'm not blocking third-party cookies all of a sudden, and have no adblockers enabled.
Interestingly, if I take the cookiepro code and just stick into the html template file, I get the same result as with this module. I reinstalled the cookiepro module, leaving the code in the html.html.twig file, didn't update the module config, and the banner worked as expected again - both cookies were set correctly. So it seems like something in the module is "allowing" the cookies to be set.
Am I missing something in the config process of the cookiepro_plus module?
Comments
Comment #2
davemybes commentedComment #3
andreasderijckeThis behaviour is typical if you're testing on a different domain than the production domain and loading the script from the production CDN, as in that case, the consent cookie will always be created using the production domain.
From https://my.onetrust.com/s/article/UUID-7478d3b4-18eb-3ac0-a6fd-fb7ebff9f8dc,
If that is the case, did you enable the 'Enable Testing CDN' in the module settings? (see https://www.drupal.org/files/cookiepro_plus_options_basic.jpg)
This supports previous possible cause.
If your config (snippet) if the cookiepro module does contain the '-test' to load from testing CDN, than this makes sense if that's what is missing here.
If not, then I'm currently at loss too.
This module is mainly about being able to control CookiePro script options from Drupal config, when to inject it and having the button, cookie list snippets as tokens, blocks etc.
The cookie creation is still entirely up to the CookiePro script itself.
Last Drupal version I deployed this on, 10.1.4, all working as expected. But of course, things change.
What Drupal core version are you using? What script version is published?
If you're sure all config for this module is correct, can you send me the script ID using contact form on my account (I've just enabled it), so I try to get it running on a test site?
Comment #4
davemybes commentedGreat tip about the Testing CDN option - that appears to have fixed the cookie setting issue. I couldn't understand why cookiepro was working with the production code, though, so I checked the code base and we're overriding that code with the -test code in settings.php for non-prod environments. So that explains why it worked with that module.
I really appreciate your very quick and informative response. And thanks for having a great alternative to cookiepro.
Comment #5
andreasderijckeGlad to hear, and welcome.