Utilicé la siguiente función de javascript para nuestro mensaje de consentimiento de cookies en nuestro sitio web. ¿Cómo puedo agregar el código de Mailchimp a esto? El problema es que Mailchimp necesita el <script id="mcjs">
Código que estoy usando para comprobar si alguien permite las cookies. Si es así, active Google Analytics, etc.
function BlockCookie() { var imported = document.createElement('script'); imported.src = 'https://www.googletagmanager.com/gtag/js?id=ANALYTICS_CODE'; document.head.appendChild(imported); window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'ANALYTICS_CODE', { 'anonymize_ip': true }); window._mfq = window._mfq || []; (function() { var mf = document.createElement(\"script\"); mf.type = \"text/javascript\"; mf.defer = true; mf.src = \"//cdn.mouseflow.com/projects/cae0bb6e-2421-49b4.js\"; document.getElementsByTagName(\"head\")[0].appendChild(mf); })(); }Código de Mailchimp que me gustaría agregar a la función
<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/01ad3420bde595/306da052f4.js");</script>