Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created June 7, 2017 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miguelmota/8bba8d30a148ce0f4f001752a107237a to your computer and use it in GitHub Desktop.
Save miguelmota/8bba8d30a148ce0f4f001752a107237a to your computer and use it in GitHub Desktop.
MailChimp sign up popup on click + clear expire cookie
<button id="open-popup">Sign Up</button>
<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>
<script>
function showMailingPopUp() {
var config={"baseUrl":"mc.us5.list-manage.com","uuid":"0b1e10820775a3f...","lid":"738208..."}
require(["mojo/signup-forms/Loader"], function(L) {
L.start(config)
})
document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/";
}
document.getElementById("open-popup")
.addEventListener('click', function(event) {
showMailingPopUp()
})
</script>
@9898031
Copy link

9898031 commented Dec 26, 2017

hello how i can expire cookie after 1 min now it's 1 year send me code please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment