Here is how to add cookies to a custom modal

Hi everyone!

Don’t forget to add the script source for the cookie library. You can also change the cookie name and class names according to your own structure and requirements. Here’s the full code again:

<!-- Modal Cookie -->
<script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script>
<script>
var yourCookieName = 'yourVistorsAction';

if(typeof Cookies.get(yourCookieName) !== 'undefined') {
$('.your-modal-parent-class').remove();
}

$('.your-modal-bg-class, .your-close-button-class').on('click', function(){
Cookies.set(yourCookieName, 'ok', { expires: 7 });
})
</script>