Hello Bricks Community,
I need help setting up a cookie consent popup that will appear on every page of my site until the user confirms it by clicking the “OK” button. I have created a popup element, but I am struggling to ensure it displays site-wide and remains until confirmed. How can I effectively achieve this?
Here is what I have tried so far:
- Created a popup element.
- Added text and a close button inside the popup.
- Attempted to use JavaScript to manage the display, but it is not working as expected.
- In the settings, I set it to show only once per session or for a certain period. However, the popup hides upon clicking “OK,” but reappears upon page reload.
Any help or detailed steps would be greatly appreciated!
Thank you,
I can’t test this right now but I would think add another interaction to the OK button that when clicked adds a local browser storage key, this serves as a kind of cookie that you can check is present… then add another interaction that when the content is loaded, hide element, popup, select your popup… and underneath that add an interaction condition that checks for the key set… this way your popup should never show as long as that key is present on the persons computer/storage device… hope that make sense…
UPDATE
I can now confirm this works after some testing. Basically 3 main interactions on the OK button:
- Click interaction to close the popup.
- Click interaction Browser Storage: add and Local Storage, there set a key eg: verified
- Content Loaded interaction and Hide Element Popup and select your cookie popup
Under that interaction add an interactive condition type of local storage and there type in the key you use eg: verified
This should ensure that key is added to the users local storage device and will fire off the hide element interaction when present meaning your popup should not be shown.
Hope this helps.
1 Like
Thank you very much, it works!
But “pro friends” (
) told me that its fake popup, they mean if i show the popup window, i must use collect cookies and before accepting cookies from user i can’t collect cookies , what about this?
I don’t know much about that but I do believe they are correct because there is more to a cookie consent popup than just a popup. It collects the cookie data your site uses and then denies or accepts based on the users input, some even allowing you to selectively choose which cookies are ok.
I would go with a proper cookie consent plugin like Complianz – GDPR. Hope this helps.
1 Like
Yes, i have already installed it and trying to figure out!))
Thanks a lot
Greetings from Armenia <3
1 Like