收集内容的 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
) 必须满足以下要求:
- 在您的目录中是全局唯一的
- 例如,请勿为
TVSeries
和 TVSeason
使用相同的 @id
。
- 静态
- 采用统一资源标识符 (URI) 的形式
- 如果内容的本地标识符 (ID) 不是 URI 格式,请在 ID 前面附加您的网域以满足此要求;例如,如果内容的 ID 是 1234abc,而您的网域是 https://example.com,则
@id
可以是 https://example.com/1234abc。
@id
不一定是有效网址;它只需采用 URI 格式即可。
@id
中使用的网域(例如 https://example.com)必须归贵组织所有。
由于实体的 url
符合作为标识符的所有要求(即全局唯一、静态且采用 URI 格式),因此我们建议您将实体的 url
用作 @id
。
规范网址
规范网址 (url
) 有助于 Google 准确匹配您的目录中的内容与 Google 数据库中的内容。
“规范网址是 Google 认为在您网站上的一组重复网页中最具代表性的网页的网址。举例来说,如果同一个网页有多个网址(例如:example.com?dress=1234 和 example.com/dresses/1234),Google 便会从中选择一个网址作为规范网址。”(来源:整合重复网址)
规范网址须满足以下要求:
url
必须是全局唯一的。
url
必须包含 Google 可以抓取的有效规范网址。
- (仅限“Listen”操作)
url
需要指向未被付费墙屏蔽的内容说明页。
收集 ID、网址和名称
执行以下操作:
- 收集目录中内容的名称。
- 指明相应内容的规范网址。(我们建议您将内容的
url
用作其 @id
。)
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
[null,null,[],[[["\u003cp\u003eAll catalog entities must have an \u003ccode\u003e@id\u003c/code\u003e, \u003ccode\u003eurl\u003c/code\u003e, and \u003ccode\u003ename\u003c/code\u003e property for identification and discoverability.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e@id\u003c/code\u003e should be a globally unique, static URI, preferably the same as the \u003ccode\u003eurl\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eurl\u003c/code\u003e must be a working canonical URL for Google to crawl and reconcile content effectively, pointing to a public content description page for Listen Actions.\u003c/p\u003e\n"],["\u003cp\u003eYou need to collect and provide the \u003ccode\u003ename\u003c/code\u003e, \u003ccode\u003eurl\u003c/code\u003e (recommended for \u003ccode\u003e@id\u003c/code\u003e), and canonical \u003ccode\u003eurl\u003c/code\u003e for each entity in your catalog.\u003c/p\u003e\n"]]],["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"],null,["# Collect the ID, URL, and name of your content\n\nAll the entities in your catalog require the following properties:\n\n- `@id`: A global [identifier](#identifier) for the content.\n- `url`: A [canonical URL](#canonical_url) for the content.\n- `name`: The name of the content.\n\nExample of `@id`, `url`, and `name`: \n\n \"@id\": \"http://www.example.com/episode/video/432432432\",\n \"url\": \"http://www.example.com/episode/video/432432432\",\n \"name\": \"My example episode\",\n\nIdentifier\n----------\n\nAn identifier (`@id`) must meet the following requirements:\n\n- Globally unique across your catalog\n - For instance, don't use the same `@id` for a `TVSeries` and a `TVSeason`.\n- Static\n - You cannot change `@id` later.\n- In the form of Unified Resource Identifier (URI)\n - If your content's local identifier (ID) is not in a URI format, prepend your domain to the ID to satisfy this requirement; for example, if your content's ID is *1234abc* and your domain is *https://example.com* , `@id` can be *https://example.com/1234abc.*\n - `@id` does not have to be a working URL; it only needs to be in a URI format.\n - The domain used in `@id` (for example, *https://example.com*) must be owned by your organization.\n\nBecause an entity's `url` meets all the requirements as an identifier (that is, globally unique, static, and in the form of a URI), we recommend you use an entity's `url` as `@id`.\n\nCanonical URL\n-------------\n\nA canonical URL (`url`) helps Google accurately reconcile the content in your catalog with the content in Google's databases.\n\n\"A canonical URL is the URL of the page that Google thinks is most representative from a set of duplicate pages on your site. For example, if you have URLs for the same page (for example: *example.com?dress=1234* and *example.com/dresses/1234* ), Google chooses one as canonical.\" (Source: [Consolidate duplicate URLs](https://support.google.com/webmasters/answer/139066))\n\nThe following are the requirements for the canonical URL:\n\n- `url` must be globally unique.\n- `url` must contain a working canonical URL that Google can crawl.\n- (Listen Actions only) `url` needs to point to a content description page that is not blocked by a paywall.\n\nCollect the ID, URL, and name\n-----------------------------\n\nDo the following:\n\n1. Gather the names of the content in your catalog.\n2. Identify the canonical URLs of the content. (We recommend you use the content's `url` as its `@id`.)"]]