Home / Companies / Google Cloud / Blog / Post Details
Content Deep Dive

An async script for AdSense tagging

Blog post from Google Cloud

Post Details
Company
Date Published
Author
-
Word Count
514
Language
English
Hacker News Points
-
Summary

In a bid to enhance web performance, Google's Ads Latency Team introduced a new asynchronous script tag for AdSense ads that allows web pages to load more efficiently, even with slow network connections. This modern method, which uses the <script async> mechanism, prevents the script from becoming a bottleneck and ensures that the page can fully render independently of the ad script's loading speed. Unlike the traditional blocking script tag approach, this new tag allows ad slot configuration and placement within the DOM, thereby promoting better integration and efficiency, especially on mobile devices where network stability can be unreliable. The new system involves a single script that can be placed at the page's top, a DOM element for ad display, and a call to adsbygoogle.push() to manage ad slots. While the classic show_ads.js has been reliable, the new adsbygoogle.js, still in beta, offers a promising alternative for users seeking to prevent ads from hindering content display. Michael Kleber, the Tech Lead of the team, encourages users to adopt this new method to improve web experience, reflecting his extensive expertise in internet speed optimization and his diverse background in mathematics, computational biology, and machine learning.