收集內容的 ID、網址和名稱
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
目錄中的所有實體都需要下列屬性:
@id
:內容的全球ID。
url
:內容的標準網址。
name
:內容名稱。
@id
、url
與 name
的範例:
"@id": "http://www.example.com/episode/video/432432432",
"url": "http://www.example.com/episode/video/432432432",
"name": "My example episode",
ID
ID (@id
) 必須符合下列規定:
- 在目錄中全域專屬
- 舉例來說,請勿為
TVSeries
和 TVSeason
使用相同的 @id
。
- 靜態
- 統一資源識別碼 (URI) 格式
- 如果內容的本機 ID 不是以 URI 格式表示,請在 ID 前方加上網域,以符合這項規定。舉例來說,如果內容的 ID 是 1234abc,網域是 https://example.com,
@id
可以是 https://example.com/1234abc。
@id
不必是有效網址,只要是 URI 格式即可。
@id
中使用的網域 (例如 https://example.com) 必須由貴機構所擁有。
實體的 url
符合 ID 的所有必要條件 (也就是全域不重複、靜態且採 URI 格式),因此建議您將實體的 url
做為 @id
。
標準網址
標準網址 (url
) 可協助 Google 準確比對目錄中的內容與 Google 資料庫中的內容。
「標準網址」是指 Google 從網站的一組重複網頁中選出的最具代表性網頁的網址。舉例來說,如果同一個網頁有多個網址,例如 example.com?dress=1234 和 example.com/dresses/1234,Google 便會選擇其中之一做為標準網址。(來源:整合重複的網址)
以下是標準網址的相關規定:
url
須為全域唯一值。
url
必須包含 Google 可檢索的有效標準網址。
- (僅限 Listen 動作)
url
必須指向不受付費牆限制的內容說明頁面。
收集 ID、網址和名稱
請完成下列步驟:
- 收集目錄中的內容名稱。
- 找出內容的標準網址。(建議您使用內容的
url
做為 @id
)。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],[],[[["All catalog entities must have an `@id`, `url`, and `name` property for identification and discoverability."],["The `@id` should be a globally unique, static URI, preferably the same as the `url`."],["The `url` must be a working canonical URL for Google to crawl and reconcile content effectively, pointing to a public content description page for Listen Actions."],["You need to collect and provide the `name`, `url` (recommended for `@id`), and canonical `url` for each entity in your catalog."]]],["Entities require `@id`, `url`, and `name` properties. `@id` must be a globally unique, static URI, which can be a prepended domain to a local ID. `url` must be a globally unique, working canonical URL, crawlable by Google. It's recommended to use the `url` as the `@id` because it satisfies the identifier requirements. The process involves collecting content names and identifying their canonical URLs.\n"]]