Skip to main content
How do I embed a Cookie Preference Button on a Wix website?
Updated over a week ago

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.

  1. In your Wix website editor, click + in the left-hand menu, then click Button.

  2. Add a Themed Button or Text & Icon Button.

  3. Change the button text to say "Cookie Preferences" — this naming is necessary in order for the code below to work correctly.

  1. Open the Custom Code page on your Wix dashboard. Click + Custom Code in the upper-right corner.

  2. Copy the code snippet below and paste it into the Paste the code snippet here: text box.

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});
  1. Name your code "Cookie Preferences."

  2. Choose the page you want your Cookie Preferences button on in the Add Code to Pages: section.

  3. 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.

Did this answer your question?