Before you implement the Cookie Preference Button on Wix, make sure you have installed the consent banner code snippet correctly.
You can find instructions about adding buttons to Wix websites on their help center, both for using the classic web editor, and for the ADI editor. We've summarized the relevant steps on this page.
In your Wix website editor, click + in the left-hand menu, then click Button.
Add a Themed Button or Text & Icon Button.
Change the button text to say "Cookie Preferences" — this naming is necessary in order for the code below to work correctly.
Open the Custom Code page on your Wix dashboard. Click + Custom Code in the upper-right corner.
Copy the code snippet below and paste it into the Paste the code snippet here: text box.
<script> window.addEventListener("onWidgetLoadComplete",function(){let e=document.querySelectorAll('div[role="button"]');for(let o of e)"Cookie Preferences"===o.textContent&&window.displayPreferenceModal&&(o.onclick=window.displayPreferenceModal);let o=document.querySelectorAll('button[aria-label="Cookie Preferences"]');for(let e of o)e.onclick=window.displayPreferenceModal}); </script>
Name your code "Cookie Preferences."
Choose the page you want your Cookie Preferences button on in the Add Code to Pages: section.
Select Body - end in the Place Code in: section. Your custom code details should look similar to the screenshot below.
Your cookie preferences center should now be accessible on your Wix site.
If you are still experiencing issues, please reach out to [email protected] for more help.