It's here, here at last! Only about a decade too late, and about six or seven years after Google announced they were working on it.

AdSense now offers asynchronous code, finally. It looks something like this:

<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-xxxxxx"
     data-ad-slot="xxxxxx"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Asynchronous code is non-page blocking, meaning it doesn't slow down the rendering of the page, and only loads the ads after the rest of the page has already finished loading.

Member Avatar for LastMitch

Asynchronous code is non-page blocking, meaning it doesn't slow down the rendering of the page, and only loads the ads after the rest of the page has already finished loading

I actually do have a google adsense account but never really used it to make money. I might try that since you provided a code and explanation. Not sure how it works but I'll learn it. Thanks for sharing.

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.