we have Magento 2.1.7ce and would like to add the MailChimp popup to our homepage.

We currently don't have access to the FTP/SSH so we have to do this with the cms pages.

When i add this code to a CMS page:

<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 type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us7.list-manage.com","uuid":"xxxxxxxxxxxxxxxxxxxxxxxx","lid":"xxxxxxxxxxx"}) })</script>

And access the firebug console sees it's trying to load files from the static files:

"NetworkError: 404 Not Found - https://server.com/static/frontend/Theme/customtheme/nl_NL/mojo/signup-forms/Loader.js

"NetworkError: 404 Not Found - https://server.com/static/frontend/Theme/customtheme/nl_NL/dojo.js"

How can I fix this? Or is it not allowed to use JavaScript in cms pages?

4 Answers 4


Mailchimp uses dojo for managing required modules and dependencies.


require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us7.list-manage.com","uuid":"xxxxxxxxxxxxxxxxxxxxxxxx","lid":"xxxxxxxxxxx"}) })

conflicts with the RequireJS, that is used in Magento.

You can use Mailchimp Embedded forms instead of the Subscriber pop-up and use Modal widget for embedding form into popup


I've built the modal popup and it all works.

Structure includes calling a block called newsletter.php which has return 'Dummy Content' in it.

Question is,

I've got the embed form code from my mailchimp account by I don't know how to add that to a block in M2 or should I scrap the block and just add it into the newsletter.phtml file?

I'm a bit confused


Magento allow to use JavaScript in cms pages.

I tried your js, the //s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js js loaded well.

The problem is lacking dojo.js.

If you don't have access to the ftp/SSH, you could upload the dojo.js to s3.amazonaws.com, then load it like embed.js,


<script type="text/javascript" src="//s3.amazonaws.com/the-path-to/dojo.js" > </script>

After you load embed.js, if it still doesn't work, use the develop tool(Chrome is F12) to find the problem. I guess the "mailchimp popup" function need several js files, you doesn't upload and use them completely.

  • Any solution for this fix ?
    – Learner
    Commented Nov 22, 2017 at 13:28

conflicts with the RequireJS, that is used in Magento so that we can use different code try below code which works well

<script type="text/javascript"
        data-dojo-config="usePlainJson: true, isDebug: false"></script>
<script type="text/javascript">
  setTimeout(mailchimp, 2000);
  function mailchimp() {
    window.dojoRequire(["mojo/signup-forms/Loader"], function(L) {
        "baseUrl": "mc.xxx.list-manage.com",
        "uuid": "xxxxx",
        "lid": "xxxxx",
        "uniqueMethods": true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.