Website Building » Wix » How Do You Add a Pop Up Cookie on Wix?

How Do You Add a Pop Up Cookie on Wix?

Last updated on December 23, 2022 @ 4:25 pm

There are a few ways to add a pop up cookie on Wix. One way is to use the Wix Code.

The other way is to use a third-party app or plugin.

GREAT NEWS:

Exciting update! We've collaborated with Wix to offer WBI users with a free plan for all website creation needs - Explore the details here.

If you want to use the Wix Code, you will need to follow these steps:

  1. First, log in to your Wix account and go to the editor for the page or site where you want to add the pop up cookie.
  2. Click on the “Add” button in the top menu and select “HTML Code” from the dropdown menu.
  3. In the HTML Code box that appears, you can paste the code for the pop up cookie. There are many different options for pop up cookies, so you may need to do some research to find the one that best fits your needs.
  4. Once you have pasted the code into the HTML Code box, click “Apply” to add the pop up cookie to your site.

Here is an example of an HTML code for a pop up cookie on Wix:

<div id="cookie-notice">
<p>This website uses cookies to ensure you get the best
 experience on our website. By continuing to use this site,
 you consent to the use of cookies. 
<a href="/privacy-policy">Learn more</a></p>
<button id="cookie-notice-accept">Accept</button>
</div>

To make the pop up cookie actually appear on your Wix site, you will need to add some JavaScript code that triggers the pop up to display when the page loads. Here is an example of some JavaScript code that could be used to do this:

document.addEventListener('DOMContentLoaded', function() {
// Show the cookie notice
document.getElementById('cookie-notice')
  .style.display = 'block'; 
// Hide the cookie notice when the accept button is clicked 
document.getElementById('cookie-notice-accept')
 .addEventListener('click', function() { 
document.getElementById('cookie-notice')
 .style.display = 'none'; 
}); 
});

This code uses the DOMContentLoaded event to ensure that the pop up cookie is displayed only after the page has finished loading. It also adds an event listener to the accept button, which hides the pop up cookie when the button is clicked.

You can add this JavaScript code to your Wix site using the HTML Code element, just like you did with the HTML code for the pop up cookie.

Remember to test your pop up cookie on your Wix site to make sure it is working as intended. You may also want to consider using a cookie consent tool or plugin to manage cookies on your site and ensure that you are complying with relevant laws and regulations.

If you want to use a third-party app or plugin, there are many options available. Some popular options include:

  • Cookie Consent: This app allows you to easily customize and add a pop up cookie to your Wix site.
  • Cookie Notice: This plugin allows you to add a customizable cookie notice to your Wix site.
  • GDPR Cookie Consent: This app helps you to comply with the General Data Protection Regulation (GDPR) and allows you to add a customizable cookie notice to your Wix site.

To add a third-party app or plugin to your Wix site, you will need to follow the instructions provided by the app or plugin. This usually involves installing the app or plugin from the Wix App Market and then configuring it to meet your needs.

It’s important to note that you should be sure to read and understand the terms of use and privacy policies of any third-party apps or plugins you use on your Wix site. Additionally, you should be sure to comply with any relevant laws and regulations, such as the GDPR, when using cookies on your site.

Kathy McFarland

Kathy McFarland

Devops woman in trade, tech explorer and problem navigator.