Skip to content

Magento 2.4.0 – Mailchimp “Site status undetermined” when adding JS code

I’m on Magento 2.4.0 and trying to connect my store to Mailchimp.

Steps I tried:

In Content → Design → Configuration, I edited my store view.

Pasted Mailchimp’s verification JS code in the Scripts and Style Sheets section (header).
Saved and cleared cache.

However, when I go to Mailchimp → Check Connection, it always says:

Site status undetermined

The JS is loading in the page source, but it seems Mailchimp still can’t detect it.

I found some posts saying the code needs to be placed directly above in the HTML.

Questions:

Is there a way in Magento 2 to insert this script exactly before ?

Is adding it in a layout XML like default_head_blocks.xml or default.xml the correct fix?