Site logo

[Support request] load JS on scroll event

Home Forums Support [Support request] load JS on scroll event

Home Forums Support load JS on scroll event

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1798501
    Mouse

    Hi, there, I was doing this thing before shifting to Ezoic where I was lazy loading Adsense ads on scroll with the following code:

    <script type=’text/javascript’> //<![CDATA[ var la=!1;window.addEventListener(“scroll”,function(){(0!=document.documentElement.scrollTop&&!1===la||0!=document.body.scrollTop&&!1===la)&&(!function(){var e=document.createElement(“script”);e.type=”text/javascript”,e.async=!0,e.src=”https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&#8221;;var a=document.getElementsByTagName(“script”)[0];a.parentNode.insertBefore(e,a)}(),la=!0)},!0); //]]> </script>
    With this I was able to achieve 100 PSI scores on both Dekstop and Mobile.

    Can same be applied for now for Ezoic ads? If not what is the way to apply load on scroll for external ad js. Is there a way?
    Been searching on it for hours before coming to you.

    #1798569
    David
    Staff
    Customer Support

    Hi there,

    sorry this is out of this support forums scope – the Theme has no responsibility for the loading of adverts.
    Might be best to ask Ezoic support.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.