elleracompany / craft-cookie-consent

GDPR-Compliant cookie consent banner for Craft CMS
Other
6 stars 5 forks source link

window.ccc is undefined #102

Closed pmichaelis closed 4 months ago

pmichaelis commented 1 year ago

The documentation says that there is a window.ccc object since version 1.6.0, but the object is always undefined. I need to set cookies without refreshing the page. Is there any way to that?

Thanks

jellingsen commented 1 year ago

I'll investigate the window.ccc issue.

The cookie is set without refreshing the page, but if you're using craft/twig to determine if scripts should be rendered you have to reload the page. It should be possible to to do this with JS and remove the need for a page reload, but you probably need access to the window.ccc-object :/

jellingsen commented 4 months ago

I can access the window.ccc object in the console. Are you using the default java script code, and are you sure that is loaded before you attempt to access the object?

Cookies are updated without updating the page currently, unless you've enabled Automatic Refresh in Site Settings.