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.
4. In the upper navigation bay, select Dev Mode and click the Turn on Dev Mode button.
5. Copy the code snippet below and paste it into the Code Editor:
$w.onReady(function () {
// Get all buttons on the page
const buttons = $w('Button');
// Loop through and find the button with the desired text
buttons.forEach((btn) => {
if (btn.label === 'Cookie Preferences') {
// Add the class
btn.customClassList.add('termly-display-preferences');
}
});
});
That's it and you're done. Your cookie preferences center should now be accessible on your Wix site.
If you are still experiencing issues, please reach out to support@termly.io for more help.