Hey guys! This article is a short and simple article in which I will show you the best way to embed/integrate mailchimp form to your website. A few days back I developed an obsession with Google Pagespeed Insight. Not because I want good SEO but because I like perfection. I had to Embed Mailchimp form in order to get the best score from my side. It was a ADU in the process. I searched google for the answers but there were no good articles explaining about the best way to integrate mailchimp to the website. So, I started my own tweaks and finally after half hour of experimentation I was able to find a solution.
Best Way to Embed Mailchimp Subscription Form
I’m hoping that you already have a mailchimp account registered and has created a subscription form from their backend. If you do not know how to create a form with mailchimp then read – Create Signup forms with mailchimp, and come back quickly. Once you have created a signup form, you will get a code something similar to,
<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.us12.list-manage.com","uuid":"YOUR_UUID","lid":"YOUR_LID"}) }) </script>
You just need to replace the above code with the code below,
<script defer 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 defer> function showMailingPopUp() { console.log("POPUP LOADED") ???require(["mojo/signup-forms/Loader"], function(L) { ???????L.start({"baseUrl":"mc.us12.list-manage.com","uuid":"YOUR_UUID","lid":"YOUR_LID"}) }); }; setTimeout(function() { showMailingPopUp() }, 10000); </script>
Note – Replace YOUR_UUID with your actual uuid and YOUR_LID with your actual lid.
You can also edit the number of seconds before ?you want subscription form to load. Try to choose a number which does not feel impromptu or very delayed. Try to load a form somewhere between 5 seconds to 15 seconds. However, these are my personal recommendation. You are free to choose any number based on your strategy. This is all you need to do in order to get a better score in your google pagespeed insights.
If this article helped you then do share and subscribe. Also, if you want to score a perfect 100 in google pagespeed insights then subscribe to BMA and we will send you article directly into your inbox.
And as always,
Be my aficionado 🙂