Site logo

Archived topic

Defer loading of GP element script

5 replies · Started by Junior Gong on September 28, 2020

Viewing posts 1–6 of 6

Hey guys

for our email optins we are using mailerlite popup forms which we added as a gp element
Is there any way to defer the loading?

Hi there,

can i see the site where the script is hooked in so i can take a look?

Sure. It's in private info in this reply

Can you provide a copy of the code you're adding to the Element ( You can delete any API Keys from the code ).

Sure

<!-- MailerLite Universal -->
<script>
(function(m,a,i,l,e,r){ m['MailerLiteObject']=e;function f(){
var c={ a:arguments,q:[]};var r=this.push(c);return "number"!=typeof r?r:f.bind(c.q);}
f.q=f.q||[];m[e]=m[e]||f.bind(f.q);m[e].q=m[e].q||f.q;r=a.createElement(i);
var _=a.getElementsByTagName(i)[0];r.async=1;r.src=l+'?v'+(~~(new Date().getTime()/1000000));
_.parentNode.insertBefore(r,_);})(window, document, 'script', 'https://static.mailerlite.com/js/universal.js', 'ml');

var ml_account = ml('accounts', 'xxxx', 'xxxx', 'load');
</script>
<!-- End MailerLite Universal -->
<script>
    var ml_webform_xxxx = ml_account('webforms', 'xxxxx', 'xxxxxi', 'load');
    ml_webform_xxxxx('animation', 'fadeIn');
</script>

Hi there,

Is this script already loaded in the footer? If so, there's no need to defer it - it's deferred by default as it only loads when it's reached at the end of the page.

This archived topic is closed to new replies.