透過 HTTPS 載入廣告代碼
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
總覽
確保廣告代碼程式庫指令碼的請求安全無虞。這不僅可為使用者提供更完善的安全性,也能提升效能。由於 GPT 發出的廣告請求一律使用 HTTPS,透過 HTTPS 從建議的主機 載入程式庫,可確保瀏覽器只需針對所有廣告放送相關請求開啟 1 個連線。
注意: 只有在不安全的網站上才能載入,因為大多數安全網站都會自動使用 HTTPS 載入指令碼。
建議
請一律從 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>
正確
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
系統支援下列廣告代碼程式庫指令碼:
媒體庫
指令碼
AdSense
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 發布商廣告代碼
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權 ,程式碼範例則為阿帕契 2.0 授權 。詳情請參閱《Google Developers 網站政策 》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-06-26 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]