1

I am trying to open my mailchimp popup on clicking an element, but I am not seeing anything. I've followed this answer but it's not working for me. I can see something is happening in the network settings when I click my element. And when I console log something it shows when I click the element, so the js is working fine. That question/answer is 2 years old so maybe something has changed on mailchimps side?

My code at the moment:

My element:

<a style="width:100%;margin-top:20px;margin-bottom:20px;" href="javascript:void(0);" id="ctabutton" class="ctabutton ctabuttonmobiel open-popup kl-cta-ribbon" title="VRAAG EEN SCHERPE OFFERTE AAN"><strong>INSCHRIJVEN VOOR DE NIEUWSBRIEF</strong><svg version="1.1" class="trisvg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" preserveaspectratio="none" width="14px" height="5px" viewbox="0 0 14.017 5.006" enable-background="new 0 0 14.017 5.006" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.016,0L7.008,5.006L0,0H14.016z"></path></svg></a>

My js code:

function showMailingPopUp() {
          require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us16.list-manage.com","uuid":"fab44298b45bd02e4d7427594","lid":"23ebf55005"})})
          document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
      };

      jQuery(function() {
          jQuery(".open-popup").on('click', function() {
              showMailingPopUp();
          });
      });
twan
  • 2,450
  • 10
  • 32
  • 92

1 Answers1

0

Instead of document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; just add these two lines to set cookies date and it work document.cookie = "MCPopupClosed=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC"; document.cookie = "MCPopupSubscribed=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC";