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
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" or other naming convention that you would like to follow.
Adding the Code for Cookie Preference Button
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.