Stay organized with collections
Save and categorize content based on your preferences.
Overview
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.
Recommendations
Always load your ad tag scripts from an HTTPS URL.
Incorrect
<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>
[null,null,["Last updated 2024-06-26 UTC."],[],["Ad tag library scripts should be loaded via HTTPS for enhanced security and performance. Always use HTTPS URLs to load scripts; avoid HTTP. Secure loading ensures a single browser connection for all ad-related requests, as GPT uses HTTPS. Supported scripts include those for AdSense (e.g., `pagead2.googlesyndication.com/pagead/js/adsbygoogle.js`) and Google Publisher Tag (e.g., `securepubads.g.doubleclick.net/tag/js/gpt.js`). The correct implementation is loading scripts such as `https://securepubads.g.doubleclick.net/tag/js/gpt.js` using the script tag.\n"],null,[]]