با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
نمای کلی
اطمینان حاصل می کند که اسکریپت های کتابخانه برچسب تبلیغات به صورت ایمن درخواست می شوند. این نه تنها امنیت بهتری را برای کاربران شما فراهم می کند، بلکه عملکرد را نیز بهبود می بخشد. از آنجایی که درخواستهای آگهی صادر شده توسط GPT همیشه از HTTPS استفاده میکنند، بارگیری خود کتابخانه از میزبان توصیهشده از طریق HTTPS تضمین میکند که مرورگر فقط باید 1 اتصال را برای همه درخواستهای مربوط به ارائه آگهی باز کند.
توصیه ها
همیشه اسکریپت های تگ تبلیغات خود را از یک URL HTTPS بارگیری کنید.
نادرست است
<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>
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\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"]]