Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Descripción general
Garantiza que las secuencias de comandos de la biblioteca de etiquetas de anuncios se soliciten de forma segura. Esto no solo
proporciona mayor seguridad a los usuarios y, además, mejora el rendimiento. Desde el anuncio
Las solicitudes emitidas por GPT siempre usan HTTPS, cargando la propia biblioteca desde el
host recomendado a través de HTTPS garantiza que la
el navegador solo necesita abrir 1 conexión para todas las solicitudes relacionadas con la publicación de anuncios.
Recomendaciones
Carga siempre las secuencias de comandos de tus etiquetas de anuncios desde una URL HTTPS.
Incorrecto
<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,["Última actualización: 2025-07-25 (UTC)"],[[["\u003cp\u003eLoading ad tag library scripts securely over HTTPS enhances security and performance for users.\u003c/p\u003e\n"],["\u003cp\u003eBrowsers establish a single connection for ad serving when GPT and its library are fetched via HTTPS.\u003c/p\u003e\n"],["\u003cp\u003eAd tag scripts should always be loaded from an HTTPS URL for optimal security.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Publisher Tag and AdSense are among the supported ad tag library scripts, and their HTTPS URLs are provided for reference.\u003c/p\u003e\n"]]],["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,["# Load ad tag over HTTPS\n\nOverview\n--------\n\nEnsures that ad tag library scripts are being requested securely. This not only\nprovides better security for your users, it also improves performance. Since ad\nrequests issued by GPT always use HTTPS, loading the library itself from the\n[recommended host](./loads-gpt-from-official-source) via HTTPS ensures that the\nbrowser only needs to open 1 connection for all requests related to ad serving.\n| **Note:** This should only fail on non-secure websites, as most secure websites will automatically load scripts using HTTPS.\n\nRecommendations\n---------------\n\nAlways load your ad tag scripts from an HTTPS URL.\n\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Incorrect** | ```html \u003cscript\u003e 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); \u003c/script\u003e ``` |\n| **Correct** | ```html \u003cscript async src=\"https://securepubads.g.doubleclick.net/tag/js/gpt.js\"\u003e\u003c/script\u003e ``` |\n\nMore information\n----------------\n\nThe following ad tag library scripts are supported:\n\n| Library | Script(s) |\n|----------------------|-------------------------------------------------------------------------------------------------------------|\n| AdSense | `pagead2.googlesyndication.com/pagead/js/adsbygoogle.js` `pagead2.googlesyndication.com/pagead/show_ads.js` |\n| Google Publisher Tag | `googletagservices.com/tag/js/gpt.js` `securepubads.g.doubleclick.net/tag/js/gpt.js` |\n\n[Get Started with Google Publisher Tags](https://developers.google.com/publisher-tag/guides/get-started) \n[View audit source](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/lighthouse-plugin-publisher-ads/audits/loads-ad-tag-over-https.js) [Improve this article](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/docs/audits/loads-ad-tag-over-https.md) [Report an issue](https://github.com/googleads/publisher-ads-lighthouse-plugin/issues/new?labels=documentation&template=documentation-feedback.md&title=Documentation+feedback%3A+loads-ad-tag-over-https.md)\n\n\u003cbr /\u003e"]]