Thanks Jane, and everybody else to making this work. I’ve successfully added to my site, too. Except: it seems to me that on Jane’s site that’s some “special” lightbox there. The overlay area, it is actually clickable. How did you do that, is it even a lightbox? (based on the code, it should be a lightbox, right?) Thanks for the help, in advance!
https://support.wix.com/en/the-wix-editor/lightbox
https://support.wix.com/en/article/designing-your-lightbox-overlay
https://support.wix.com/en/article/allowing-site-visitors-to-close-a-lightbox-by-clicking-the-overlay
Hi, @givemeawhisky ! What I meant is that you can actually click on items in the overlay area - like menu and icons - while the lightbox is still there, and not been closed.
@klikknpro Sorry, think I’m confusing things at the mo as I have temporarily reverted to the Wix cookies pop up app as my site was loading sooooo slowly with the added code on start up (visitors couldn’t do anything at all until the whole homepage had loaded as I used the onReady function, sometimes took up to 30 seconds, so my bounce rate was really high). I wanted to see if it was any better with the Wix one. It is, but it does have the flaw that you can click away from the cookies warning without actively clicking to accept cookies.
I actually think the best answer to this is Wix getting their own cookies pop up sorted. If a complete novice like me can write code that performs the task then I’m sure their experts can do something that complies with GDPR yet doesn’t slow everything down.
Hello All,
Can anyone help please?
I have also created a Cookies notification on my Wix site which basically mirrors what Jane has set up in terms of the code. The only difference is that I have modified a ‘subscription’ Lightbox as I would like it to appear at the top of the page.
Everything is working smoothly, apart from the fact that refreshing the page will displayed the Cookies Lightbox again, irrespective of clicking the Accept button.
The code I am currently using:
PAGE:
import {local} from ‘wix-storage’;
import wixWindow from “wix-window”;
import wixLocation from “wix-location”;
export function AcceptCookies_click(event, $w) {
// set flag for future visits
local.setItem(“firstTimePopupShown”, “yes”);
wixWindow.lightbox.close();
}
SITE:
import {local} from ‘wix-storage’;
import wixWindow from “wix-window”;
$w.onReady( function () {
// flag is not found
if (!local.getItem(“firstTimePopupShown”)) {
// open popup
wixWindow.openLightbox(“Cookies”);
}
} );
Any guidance on this would be great!
@_jane-1 Hello Jane,
Out of interest, does your cookie banner appear when refreshing the web page, even after clicking accept? This is happening on my website currently, and cannot understand why.
Hi James, the same happened to me. Did you figure it out already? Make sure you give the Lightbox a different name each time if you are operating several wix sites under the same account, so for example Cookie1 (for page 1), Cookie2 (for page 2) etc. Do the same with the button ID, it should work! Best, Celina
This post was originally from 2018 and is being closed.
Please add a new post rather than jumping onto an old one if more help is required.