中繼標記

我們採用一系列的中繼標記,幫助您擴充平台的廣告放送功能,以下列出這些中繼標記及其用途。

平台帳戶

中繼標記語法:

<meta name="google-adsense-platform-account" content="{host-property-code}">

{host-property-code} 看起來就像這樣:ca-host-pub-1234567890123456。主機資源代碼即為您的 AdSense 發布商 ID 加上「ca-host-」。如要查看 AdSense 發布商 ID,請前往 [帳戶] > [設定] > [帳戶資訊]

對於直接模式,這個中繼標記只有一個用途。系統會自動在該網頁上,將 data-ad-host 參數加入所有 AdSense 廣告請求。如果您在廣告程式碼中加入 data-ad-host 參數,則此參數是多餘的。

如果這個代碼會在網頁上出現好幾次,則網頁上第一個代碼的值會傳遞至所有 AdSense 廣告請求,而第二個代碼則會被忽略。

子帳戶

中繼標記語法:

<meta name="google-adsense-account" content="{sub-account}">

其中 {sub-account} 是「帳戶名稱」中的第二個發布商 ID,前面加上「ca-」。如下所示:ca-pub-0000000000000000。

在網站驗證程序期間,AdSense 會掃描網頁並進行擁有權檢查。有許多方法可以協助子帳戶通過擁有權檢查,包括透過 ads.txt、廣告程式碼或這個中繼標記。最適合的做法取決於網址結構和其他因素。請與客戶經理聯絡,瞭解最適合您平台的最佳做法。

平台作者

中繼標記語法:

<meta name="google-adsense-platform-author" content="{creator-username}">

其中 {creator-username} 是指建立這個網頁內容的使用者公開 ID。只有對於無法從網址結構中找到建立者 ID 的網域,我們才會需要使用這類中繼標記。請參考以下範例:

用途 網址結構 是否需要中繼標記?
子網域 根目錄:
https://littlepig.example.com

內容:
https://littlepig.example.com/food.html
子資料夾 根目錄:
https://example.com/littlepig

內容:
https://example.com/littlepig/food.html
子網域和子資料夾的組合 根目錄:
https://sites.example.com/sites/littlepig

內容:
https://sites.example.com/sites/littlepig/food.html
個別網址 根目錄 (或建立者個人資料):
https://example.com/user/littlepig

內容:
https://example.com/nf8ag4n

根據上表中的示例網址,中繼標記會如下所示:

<meta name="google-adsense-platform-author" content="littlepig">

我們會使用這個中繼標記中的資訊,按照內容檢查系統中所用的平台使用者來區隔網址。即使在上方表格中未列為必要項目,我們還是建議您使用這個中繼標記。