Reklam etiketini eşzamansız olarak yükleme
Genel Bakış
Bu denetim, reklam etiketi kitaplığı komut dosyalarının eşzamansız olarak yüklenmesini sağlar.
Varsayılan olarak, JavaScript eşzamanlı şekilde başlatılır. Bu, bir komut dosyasının bir
ile karşılaşıyorsanız söz konusu komut dosyası tamamlanana kadar başka içerik yüklenemez
indirilerek ayrıştırılır ve yürütüldüğünden emin olun. Eşzamansız yürütmenin etkinleştirilmesi bunu engelleyerek, belirtilen komut dosyası arka planda yüklenirken tarayıcının diğer kaynakları işlemeye devam etmesine olanak tanır. Bu, komut dosyaları yüklenirken sayfanızın duyarlı kalmasını sağlar ve tüm kritik bileşenlerin yüklenmesi için gereken süreyi azaltır.
Öneriler
Komut dosyası etiketi tanımına eşzamansız özelliğini dahil edin. Örneğin:
AdSense
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
AdSense (otomatik reklamlar)
<script async data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Google Yayıncı Etiketi
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
Aşağıdaki reklam etiketi kitaplığı komut dosyaları desteklenir:
Reklam Etiketi Kitaplığı |
Komut dosyaları |
AdSense |
pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
pagead2.googlesyndication.com/pagead/show_ads.js
|
Google Yayıncı Etiketi |
googletagservices.com/tag/js/gpt.js
securepubads.g.doubleclick.net/tag/js/gpt.js
|
Google Yayıncı Etiketlerini Kullanmaya Başlama
GPT istek modları ve eşzamansız oluşturma
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2024-10-15 UTC.
[null,null,["Son güncelleme tarihi: 2024-10-15 UTC."],[[["This audit verifies if ad tag library scripts are loaded asynchronously to improve page performance."],["Asynchronous loading allows the browser to load other content while the script loads in the background, preventing delays and improving user experience."],["To enable asynchronous loading, include the `async` attribute within the `\u003cscript\u003e` tag when implementing ad tags like AdSense and Google Publisher Tag."],["Synchronous loading, where the browser waits for the script to fully load before proceeding, can negatively impact page load times and overall performance."]]],["To optimize page load times, ad tag library scripts should load asynchronously. This is achieved by including the `async` attribute within the `\u003cscript\u003e` tag. Asynchronous loading allows the browser to continue loading other page content while the script downloads and executes in the background. Supported ad tag libraries include AdSense and Google Publisher Tag, with specific script URLs like `pagead2.googlesyndication.com/pagead/js/adsbygoogle.js` and `securepubads.g.doubleclick.net/tag/js/gpt.js` needing the `async` attribute.\n"]]