Set a Different Cookie Time on Form Submission
Let's imagine you have a form inside a popup. Whenever the popup is closed, it triggers a cookie,
But, what happens if the form is submitted and the popup is never "technically" closed? The popup will continue to trigger and spam your users!
To make sure the popup doesn't appear again, we must set up a cookie that is created on form submit so that the user will never see the popup again.
Setup Your Cookie
After clicking Add, you will be able to customize every aspect of how your cookie will behave. For detailed explanations on all of the cookie settings and features, check out the Cookie Settings and Features Doc.
Copy and paste the following code either in your parent or child theme
functions.php file, or use the My Custom Functions plugin.
Replace the popup ID number in the code example with your popup's ID number. You can find the ID under Popup Maker > All Popups > CSS Classes (column). The number at the end of the class name 'popmake-'.
View the source on GitHub.