GoogleはAdSense向け広告コードに、“完全非同期”バージョン(ベータ版)を新たに追加した。
非同期コードに置き換えることにより、ページ解析をしながらスクリプトを非同期に実行ダウンロード可能となり、ウェブページ読み込み時間短縮のほか、モバイルネットワーク環境などでもメインコンテンツのスムーズな読み込みにつながるといったメリットが生じる。
Script要素に使用されている“async”はHTML5に追加された属性。ちなみに、async以外に“defer”と呼ばれる属性もあり、こちらはHTMLの読み込みが完了した時点でスクリプトをダウンロードする際に使われる。
複数の広告ユニットを1ページ内に掲載するケースでは、スクリプト部(<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
)はページ内に一度記述すれば問題無く、できるだけトップに近い部分に記述するほうが良いようだ。
Googleは新しいコードに置き換える際は、ページ内の全ての広告ユニットを同時に切り替えることを推奨しており、まだベータ版ながらUX向上につながることが期待される。
CF : Google Developers Blog(英語)
Digital Camera Industry: Navigating Disruption The digital camera market faces a critical juncture. Global component…
Apple Introduces iPhone 16e: A New Chapter Begins, Replacing SE Apple announced the iPhone 16e…
Grok app revealed on Japanese App Store The Japanese iOS and iPadOS app market just…
Apple Silicon-optimized version of Photoshop ships with significant speed improvements After three months of testing…
Apple switching from Intel to its own custom chips for Macs over a two-year transition…
Google has finally dropped the first Android 11 Beta release for Pixel phones (Pixel 2…
This website uses cookies.