Archived topic
Mailchimp embed not working on mobile
8 replies · Started by cgk on April 3, 2018
Hi,
I have set up the Mailchimp embed code in the the wp_head hook and it works on desktop. On mobile it seems to get stuck to the top of the site, please help.
Thanks,
cgk
Hi there,
Not sure if I understand.
What code did you add in wp_head hook?
This is the code:
<script id="mcjs">!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/c82485fdbb17f3e40c2c70d06/afde539faf699f63ca873ca54.js");</script>
Thanks for your help Leo
What is the code supposed to do?
Did MailChimp provide any instruction on where to insert them?
The code is suppose to make a pop up to subscribe to my mailchimp campaign.
Here are the instructions:
Copy code
Click Copy and access your site’s HTML.
Add code
Decide which pages you want to connect to MailChimp. For each of these pages, paste in your site code just before the closing </head> tag.
I have moved the code to the After Header Content hook. I get the same result, working properly on the desktop but is hanging up on the top of mobile. It is set to pop-up on scroll to middle of page.
Ok wp_head is the correct hook.
Not sure why it isn't working on mobile though. The hook simply accepts the code you inserted without altering it.
Have you asked MailChimp to check on the issue?
Let me know.
So I put the code back in the wp_head and tested. Now all is working fine.
Thanks for your time Leo
No problem!