How to display the Mailchimp subscribe popup form on click

Question

I am using WordPress. I have to display the Mailchimp subscribe popup on click on the button.

I found some URL

https://medium.com/@rekommend_io/mailchimp-pop-up-based-on-click-a0975374c804

https://gist.github.com/scottmagdalein/259d878ad46ed6f2cdce

https://stackoverflow.com/questions/34548493/mailchimp-show-modal-sign-up-form-popup-on-button-click

Also Sharing same code here

<ul><li class="open-popup"><a href="#">Subscribe to our mailing list</a></li></ul>

<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() {
    //alert("hello");
    require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us20.list-manage.com","uuid":"bd7ed5583d8f567d56a2ed5ec","lid":"007366445e","uniqueMethods":true})})
    document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";                  
};
$(function() {
    $(".open-popup a").on('click', function() { 
        showMailingPopUp();
    });
});
</script>

But my popup not displayed after clicking on.

0
, Naren Verma 2 years 2020-01-04T08:38:51-05:00 0 Answers 83 views 0

Leave an answer

Browse
Browse