Cookie Based Email Pop-up Code Query

Yes. As the above code within that “if” statement only runs if the cookie doesn’t exist, you’d put the new code below that:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>

<script>
$(document).ready(function(){
	if (!$.cookie('alert')) {
	  $('.popup-overlay').show();   
	  var date = new Date();
    date.setTime(date.getTime() + 24 * 60 * 60 * 1000); 
 	  $.cookie('alert', true, { expires: date });
	};

    $('#mailchimp-form').on('submit',function(){
      if ($.cookie('alert')) {  
        var futureDate = new Date('Sun, 31 Dec 2099 00:00:01 GMT')
        $.cookie('alert', true, { expires: futureDate });
      };
     console.log(document.cookie);
    }) 
});
</script>

Where ‘#mailchimp-form’ is the form ID. The additional line console.log(document.cookie) will display the cookie in your browser’s console so you can read through it to check that the expiry date has changed. You can get to the browser console in Chrome using Ctrl+Shift+J (on Windows) or Option+Command+J (on Mac).