Skip to main content
How do I embed a Cookie Preference Button on a Wix website?
Updated over a month 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.
​
​

Adding the Cookie Preference Button

  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" or other naming convention that you would like to follow.

Adding the Code for Cookie Preference Button

  1. Click on Dev Mode on the upper left to open the Editor.

2. Click the Button and add an ID like #consent-pref-button in the Editor below

3. Add an event handler to the page, by pasting the code below to the Page Code Tab of the Editor.
​

$w.onReady(function () {
// Select the element by its ID
let element = $w("#consent-pref-button");

// Add the class to the element
element.customClassList.add('termly-display-preferences');
});

That's it. 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?