HTTPS를 통해 광고 태그 로드

개요

광고 태그 라이브러리 스크립트가 안전하게 요청되는지 확인합니다. 이를 통해 사용자에게 더 나은 보안을 제공할 뿐만 아니라 성능도 개선됩니다. GPT에서 제기한 광고 요청에서는 항상 HTTPS를 사용하므로 HTTPS를 통해 권장 호스트에서 라이브러리 자체를 로드하면 브라우저가 광고 게재와 관련된 모든 요청에 대해 1개의 연결만 열면 됩니다.

권장사항

항상 HTTPS URL에서 광고 태그 스크립트를 로드하세요.

올바르지 않음
<script>
  var el = document.createElement('script');
  // Incorrect: potentially loading the ad tag over HTTP.
  var useSSL = 'https:' == document.location.protocol;
  el.src = (useSSL ? 'https:' : 'http:') + '//securepubads.g.doubleclick.net/tag/js/gpt.js';
  var node = document.getElementsByTagName('script')[0];
  node.parentNode.insertBefore(el, node);
</script>
올바름
<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 게시자 태그 시작하기