79 words
1 minute
Gatsby Mailchimp Form
This is just a quick example of a script tag to load the Mailchimp script in Gatsby. I’m writing this because I had some issues with getting this to display my pop up form. To get this done I did use react-helmet
npm i react-helmet
Inside of your src/pages/index.js
file add this tag to your JSX. All you need to do is replace the https:// link to the link mailchimp gives you
<Helmet> <script id="mcjs" type="text/javascript"> {`!function (c,h,i,m,p) {m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connected/js/users/somerandomuserid/somemorerandomjs.js");`} </script> </Helmet>
Gatsby Mailchimp Form
https://edwardbeazer.com/posts/gatsby-mailchimp-form/