비동기적으로 광고 태그 로드하기
개요
이 감사를 통해 광고 태그 라이브러리 스크립트가 비동기식으로 로드되는지 확인할 수 있습니다.
기본적으로 JavaScript 실행은 동기식입니다. 즉, 스크립트가 발견되면 해당 스크립트가 다운로드되고 파싱되고 실행될 때까지 다른 콘텐츠를 로드할 수 없습니다. 비동기 실행을 선택하면
이를 통해 브라우저가 다른 리소스를 처리하면서도
지정된 스크립트가 백그라운드에서 로드됩니다. 이렇게 하면 페이지 응답성이 유지됩니다.
스크립트가 로드되는 동안 모든 중요한
구성할 수 있습니다.
권장사항
스크립트 태그 정의에 async 속성을 포함하세요. 예를 들면 다음과 같습니다.
애드센스
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
애드센스(자동 광고)
<script async data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Google 게시자 태그
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
지원되는 광고 태그 라이브러리 스크립트는 다음과 같습니다.
광고 태그 라이브러리 |
스크립트 |
애드센스 |
pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
pagead2.googlesyndication.com/pagead/show_ads.js
|
Google 게시자 태그 |
googletagservices.com/tag/js/gpt.js
securepubads.g.doubleclick.net/tag/js/gpt.js
|
Google 게시자 태그 시작하기
GPT 요청 모드 및 비동기 렌더링
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-10-15(UTC)
[null,null,["최종 업데이트: 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"]]