Help improve Publisher Ads Audits for Lighthouse. Share your thoughts in our survey.

Load ad tag over HTTPS

Stay organized with collections Save and categorize content based on your preferences.


Ensures that ad tag library scripts are being requested securely. This not only provides better security for your users, it also improves performance. Since ad requests issued by GPT always use HTTPS, loading the library itself from the recommended host via HTTPS ensures that the browser only needs to open 1 connection for all requests related to ad serving.


Always load your ad tag scripts from an HTTPS URL.

  var el = document.createElement('script');
  // Incorrect: potentially loading the ad tag over HTTP.
  var useSSL = 'https:' == document.location.protocol;
  el.src = (useSSL ? 'https:' : 'http:') + '//';
  var node = document.getElementsByTagName('script')[0];
  node.parentNode.insertBefore(el, node);
<script async src=""></script>

More information

The following ad tag library scripts are supported:

Library Script(s)

Google Publisher Tag

Get Started with Google Publisher Tags