Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nguồn cấp dữ liệu nội dung nghe nhìn là một đối tượng JSON chứa một tập hợp các thực thể đại diện cho nội dung nghe nhìn trong danh mục của bạn, chẳng hạn như Phim truyền hình dài tập, Phim, Bài hát, Đĩa nhạc, v.v. Bước đầu tiên trong quá trình làm quen là bắt đầu phát triển nguồn cấp dữ liệu. Sau khi các tệp đã sẵn sàng, bạn cần lưu trữ nguồn cấp dữ liệu bằng một trong các phương thức lưu trữ được hỗ trợ để Google thường xuyên tìm nạp.
Yêu cầu về định dạng tệp nguồn cấp dữ liệu
Sau đây là các yêu cầu đối với(các) tệp nguồn cấp dữ liệu:
Tệp nguồn cấp dữ liệu phải có đuôi tệp là .json.
Không mã hoá tệp nguồn cấp dữ liệu.
Mã hoá tệp nguồn cấp dữ liệu bằng UTF-8 (kiểm tra chế độ cài đặt trình chỉnh sửa tệp).
Chia tệp thành nhiều tệp nếu tệp nguồn cấp dữ liệu của bạn lớn hơn 1 GB (chưa nén).
Bạn nên tạo một tệp cho mỗi loại thực thể (ví dụ: tvseries.json, tvseasons.json, tvepisodes.json, movies.json, v.v.).
Nếu bất kỳ tệp nào trong số này vượt quá 1 GB, hãy chia các thực thể của tệp đó thành nhiều tệp (ví dụ: tvepisodes_01.json, tvepisodes_02.json, v.v.).
Miễn là kích thước tệp nhỏ hơn 1 GB, bạn có thể đưa bao nhiêu thực thể vào một tệp cũng được.
Đảm bảo rằng tệp được mã hoá không có BOM, theo thông số kỹ thuật JSON. Để kiểm tra trên hệ điều hành Linux, hexdump file.json | head -n 1 không được bắt đầu bằng BBEF tại địa chỉ 0x00.
Các loại nguồn cấp dữ liệu
Nguồn cấp dữ liệu phát hành công khai
Đây là tập hợp(các) tệp nguồn cấp dữ liệu json đại diện cho toàn bộ danh mục mà bạn muốn ra mắt trên Google. Bạn có thể tìm hiểu cách tạo nguồn cấp dữ liệu trong phần bên dưới.
Đây là nguồn cấp dữ liệu duy nhất bạn cần nếu đây là lần đầu tiên tích hợp với Google.
Sau khi bạn gửi nguồn cấp dữ liệu này cho Google, nguồn cấp dữ liệu này sẽ được phân tích và lặp lại nhiều lần để đạt được tiêu chuẩn chất lượng cao hơn liên quan đến lượng thông tin được thu thập và độ chính xác của nguồn cấp dữ liệu trước khi được nhập và phát hành.
Nguồn cấp dữ liệu thử nghiệm
Có một số trường hợp sử dụng nhất định yêu cầu mở rộng nguồn cấp dữ liệu chính thức. Sau đây là một số ví dụ về các trường hợp như vậy:
Mở rộng nguồn cấp dữ liệu để bao gồm các loại thực thể mới, chưa được ra mắt trước đây.
Mở rộng nguồn cấp dữ liệu để bao gồm một số lượng lớn thực thể/siêu dữ liệu mới nhằm ra mắt ở các ngôn ngữ mới.
Mở rộng nguồn cấp dữ liệu sang các loại nền tảng mới. Ví dụ: khi nguồn cấp dữ liệu chính thức chỉ được phát hành trên Google Tìm kiếm và giờ đây, bạn muốn mở rộng phạm vi phát hành sang Google TV.
Trong những trường hợp như vậy, bạn cần có nguồn cấp dữ liệu thử nghiệm. Nguồn cấp dữ liệu này là bản sao của nguồn cấp dữ liệu chính thức, ngoại trừ việc nguồn cấp dữ liệu này có siêu dữ liệu bổ sung, ví dụ: đường liên kết sâu cho một nền tảng mới, siêu dữ liệu cho một ngôn ngữ mới, v.v.
Tương tự như nguồn cấp dữ liệu chính thức, nguồn cấp dữ liệu này sẽ được phân tích và lặp lại nhiều lần để đạt được một tiêu chuẩn chất lượng cao hơn liên quan đến lượng thông tin được thu thập và độ chính xác của thông tin đó.
Sau khi đạt được tiêu chuẩn chất lượng, nguồn cấp dữ liệu này sẽ thay thế nguồn cấp dữ liệu phát hành công khai hiện tại để trở thành nguồn cấp dữ liệu phát hành công khai mới.
Nguồn cấp dữ liệu này cho phép chúng tôi tách biệt lần chạy đầu tiên với các lần chạy bổ sung, thực hiện tất cả các hoạt động kiểm thử bắt buộc mà không ảnh hưởng đến nguồn cấp dữ liệu chính thức. Điều này giúp đảm bảo trải nghiệm người dùng cuối không bị gián đoạn.
Hãy làm việc với người đại diện của Google để làm rõ mọi thắc mắc của bạn về những vấn đề nêu trên.
Tạo tệp nguồn cấp dữ liệu
Hãy làm theo các phương pháp hay nhất sau đây khi tạo nguồn cấp dữ liệu:
Trước khi tạo nguồn cấp dữ liệu chứa tất cả nội dung trong danh mục, bạn nên tạo một nguồn cấp dữ liệu mẫu chỉ chứa một nhóm nhỏ thực thể. Trong khi xử lý nguồn cấp dữ liệu, bạn có thể gặp phải một số vấn đề. Bằng cách giới hạn kích thước của tập hợp thực thể, bạn sẽ có thể gỡ lỗi các lỗi và cảnh báo này dễ dàng hơn.
Chúng tôi cung cấp các công cụ giúp đảm bảo nguồn cấp dữ liệu của bạn tuân thủ các thông số kỹ thuật. Bạn nên sử dụng các công cụ này để giải quyết tất cả lỗi và cảnh báo trong nguồn cấp dữ liệu mẫu.
Sau khi bạn xác minh rằng mình có cấu trúc phù hợp cho một nhóm nhỏ các thực thể, hãy phát triển nguồn cấp dữ liệu cho toàn bộ danh mục.
Tạo nguồn cấp dữ liệu mẫu
Chọn một thực thể đại diện trong danh mục của bạn. Chọn một thực thể có cấu trúc phức tạp vừa phải nhưng vẫn là cấu trúc điển hình của một thực thể trong danh mục.
Sử dụng Công cụ xác thực nguồn cấp dữ liệu để kiểm tra lỗi cú pháp và thiếu các thuộc tính bắt buộc. (Xem phần tiếp theo để biết thông tin chi tiết.)
Ví dụ về nguồn cấp dữ liệu có một thực thể Movie
{"@context":"http://schema.org","@type":"DataFeed","dateModified":"2018-07-20T00:44:51Z","dataFeedElement":[{"@context":["http://schema.org",{"@language":"en"}],"@type":"Movie","@id":"http://www.example.com/my_favorite_movie","url":"http://www.example.com/my_favorite_movie","name":"My Favorite Movie","potentialAction":{"@type":"WatchAction","target":{"@type":"EntryPoint","urlTemplate":"http://www.example.com/my_favorite_movie?autoplay=true","inLanguage":"en","actionPlatform":["http://schema.org/DesktopWebPlatform","http://schema.org/MobileWebPlatform","http://schema.org/AndroidPlatform","http://schema.org/AndroidTVPlatform","http://schema.org/IOSPlatform","http://schema.googleapis.com/GoogleVideoCast"]},"actionAccessibilityRequirement":{"@type":"ActionAccessSpecification","category":"subscription","requiresSubscription":{"@type":"MediaSubscription","name":"Example Package","commonTier":true,"@id":"[partner determined string]"},"availabilityStarts":"2018-07-21T10:35:29Z","availabilityEnds":"2019-10-21T10:35:29Z","eligibleRegion":[{"@type":"Country","name":"US"},{"@type":"Country","name":"CA"}]}},"sameAs":"https://en.wikipedia.org/wiki/my_favorite_movie","releasedEvent":{"@type":"PublicationEvent","startDate":"2008-01-20","location":{"@type":"Country","name":"US"}},"description":"This is my favorite movie.","actor":[{"@type":"Person","name":"John Doe","sameAs":"https://en.wikipedia.org/wiki/John_Doe"},{"@type":"Person","name":"Jane Doe","sameAs":"https://en.wikipedia.org/wiki/Jane_Doe"}],"identifier":[{"@type":"PropertyValue","propertyID":"IMDB_ID","value":"tt0123456"}]}]}
Xác thực nguồn cấp dữ liệu mẫu
Các công cụ sau đây có thể giúp bạn xác thực nguồn cấp dữ liệu mẫu bằng thông số kỹ thuật của dữ liệu có cấu trúc của Google cho nguồn cấp dữ liệu nội dung nghe nhìn.
Công cụ xác thực nguồn cấp dữ liệu
Công cụ Xác thực nguồn cấp dữ liệu có thể xác thực một thực thể tại một thời điểm. Sử dụng công cụ này để xác thực thực thể mẫu trong danh mục của bạn để tìm lỗi cấu trúc và lỗi nội dung thường gặp. Bạn có thể xem thêm thông tin chi tiết về công cụ này tại đây.
Công cụ xác thực giản đồ JSON
Công cụ Xác thực giản đồ JSON có thể xác thực tất cả tệp trong nguồn cấp dữ liệu. Hãy sử dụng công cụ này trong quá trình phát triển nguồn cấp dữ liệu để tránh các lỗi cấu trúc phổ biến. Bạn có thể xem thêm thông tin chi tiết về công cụ này tại đây.
Tạo nguồn cấp dữ liệu chính thức
Sau khi giải quyết xong tất cả lỗi và cảnh báo trong nguồn cấp dữ liệu mẫu, hãy mở rộng nguồn cấp dữ liệu để bao gồm tất cả các thực thể trong danh mục của bạn.
Thường xuyên sử dụng Công cụ xác thực nguồn cấp dữ liệu để xác thực một số ít thực thể trong nguồn cấp dữ liệu của bạn tại mỗi thời điểm (Việc dán một số lượng lớn thực thể vào công cụ này có thể khiến trình duyệt web bị treo). Xác nhận rằng nguồn cấp dữ liệu của bạn bao gồm tất cả các thực thể trong danh mục bằng cách so sánh số lượng thực thể trong nguồn cấp dữ liệu với số lượng mặt hàng trong danh mục.
[null,null,[],[[["\u003cp\u003eThe Media feed is a JSON object that contains media content, and onboarding begins with developing and hosting these feeds.\u003c/p\u003e\n"],["\u003cp\u003eFeed files must be in \u003ccode\u003e.json\u003c/code\u003e format, UTF-8 encoded without BOM, unencrypted, and potentially split into multiple files if exceeding 1GB.\u003c/p\u003e\n"],["\u003cp\u003eTwo types of feeds exist: Production feed for initial launch of your entire catalog and Staging feed for subsequent expansions or new platform integrations.\u003c/p\u003e\n"],["\u003cp\u003eBefore creating a full production feed, it is recommended to start with a sample feed, validate it using provided tools, and then expand it to include your entire catalog.\u003c/p\u003e\n"]]],["The initial step in onboarding is developing media feeds, which are JSON files representing your catalog's content. Once developed, these files must be hosted for regular Google fetching. Feed files must be in `.json` format, UTF-8 encoded, unencrypted, and under 1GB (uncompressed); splitting larger files is recommended. Two types exist: production (for initial launch) and staging (for expansion), both are validated and iterated. You should start with a small sample feed for validation, then use tools to validate it, and expand to a production feed.\n"],null,["# Create a feed\n\nThe Media feed is a JSON object that contains a collection of entities that represent the\nmedia content in your catalog, such as TV Series, Movies, Songs, Albums, and more. The first step in\nthe onboarding process is to start developing your feeds. Once the files are ready, you need to [host](./host-the-feed)\nthe feed using one of the supported hosting methods for Google to fetch regularly.\n| **Note:** If you haven't gathered all the required information for your content, see the [Collect Information](../collect-information/) section.\n\nFeed file format requirements\n-----------------------------\n\nThe following are the requirements for the feed file(s):\n\n- Feed file must have the filename extension `.json`.\n- Don't encrypt your feed file.\n- Encode your feed file in UTF-8 (check your file editor setting).\n\n- Split the file into multiple files if your feed file is larger than 1 GB (uncompressed).\n\n- We recommend you create a file per entity type (for example, `tvseries.json`, `tvseasons.json`, `tvepisodes.json`, `movies.json`, etc).\n\n - If any of these files exceeds 1GB, split its entities into multiple files (for example, `tvepisodes_01.json`, `tvepisodes_02.json`, etc).\n - As long as the file size is less than 1 GB, there is no limitation on how many entities you can include in a single file.\n- Ensure that the file is encoded **without** BOM, as per [JSON specification](https://tools.ietf.org/html/rfc7159#section-8.1). To check on a linux OS, `hexdump file.json | head -n 1` must not start with `BBEF` at address 0x00.\n\nTypes of feeds\n--------------\n\n### Production feed\n\n- This represents the set of json feed file(s) that together represent your entire catalog you want to launch on Google. You can learn how to create a feed in the section below.\n- This is the only feed you need if you are integrating with Google for the first time.\n- Once this feed is submitted to Google, it will be extensively analyzed and iterated on a few times to achieve a higher quality bar w.r.t the amount of information being captured and its correctness before it is finally ingested and launched.\n\n### Staging feed\n\n- There are certain use cases that require the expansion of the production feed. A few examples of such scenarios are:\n - Expansion of the feed to include new entity types, not previously launched.\n - Expansion of the feed to include a huge number of new entities/metadata to launch in new locales.\n - Expansion of the feed to new platform types. For example, when the production feed is only launched on Google Search and now you want to expand the launch to Google TV.\n- In such cases, a staging feed is required. This feed is a copy of the production feed except that it has additional metadata, for example, deep links for a new platform, metadata for a new locale and so on.\n- Similar to the production feed, this will be extensively analyzed and iterated on a few times to achieve a higher quality bar w.r.t the amount of information being captured and its correctness. Once the quality bar is achieved, this feed replaces the current production feed to become the new production feed.\n- This feed allows us to separate the initial launch from the additional launches, perform all required testing, without affecting the production feed. This ensures no disruptions to the end user experience.\n\nWork with your Google representative to clarify any questions you may have on the above.\n\nCreate a feed file\n------------------\n\nFollow these best practices when creating the feed:\n\n1. [Create a sample feed using a small set of entities](#create_a_sample_feed)\n\n Before building a feed that contains all the content in your catalog, we recommend you create a\n sample feed with only a small set of entities. While working on your feed, you're likely to run into\n issues. By limiting your the size of the set of entities, you will be able to debug these errors and\n warnings more easily.\n2. [Validate the sample feed](#validate_the_sample_feed)\n\n We provide tools that ensure that your feed is compliant with the specifications. We recommend\n you use these tools to resolve all the errors and warnings found in your sample feed.\n3. [Create a production feed](#create_a_production_feed)\n\n After you've verified that you have a good structure for the small set of your entities, develop a feed for your entire catalog.\n\n### Create a sample feed\n\n1. Select one representative entity from your catalog. Choose an entity with a reasonably complex structure, but is still typical for an entity in the catalog.\n 2. Use the [Data Feed Validation tool](https://actions.google.com/tools/feed-validator/u/0/) to check for syntax errors and missing required properties. (See the next section for details.) Example of a feed with a single `Movie` entity \n\n ```carbon\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"DataFeed\",\n \"dateModified\": \"2018-07-20T00:44:51Z\",\n \"dataFeedElement\": [\n {\n \"@context\": [\"http://schema.org\", {\"@language\": \"en\"}],\n \"@type\": \"Movie\",\n \"@id\": \"http://www.example.com/my_favorite_movie\",\n \"url\": \"http://www.example.com/my_favorite_movie\",\n \"name\": \"My Favorite Movie\",\n \"potentialAction\": {\n \"@type\": \"WatchAction\",\n \"target\": {\n \"@type\": \"EntryPoint\",\n \"urlTemplate\": \"http://www.example.com/my_favorite_movie?autoplay=true\",\n \"inLanguage\": \"en\",\n \"actionPlatform\": [\n \"http://schema.org/DesktopWebPlatform\",\n \"http://schema.org/MobileWebPlatform\",\n \"http://schema.org/AndroidPlatform\",\n \"http://schema.org/AndroidTVPlatform\",\n \"http://schema.org/IOSPlatform\",\n \"http://schema.googleapis.com/GoogleVideoCast\"\n ]\n },\n \"actionAccessibilityRequirement\": {\n \"@type\": \"ActionAccessSpecification\",\n \"category\": \"subscription\",\n \"requiresSubscription\": {\n \"@type\": \"MediaSubscription\",\n \"name\": \"Example Package\",\n \"commonTier\": true,\n \"@id\": \"[partner determined string]\"\n },\n \"availabilityStarts\": \"2018-07-21T10:35:29Z\",\n \"availabilityEnds\": \"2019-10-21T10:35:29Z\",\n \"eligibleRegion\": [\n {\n \"@type\": \"Country\",\n \"name\": \"US\"\n },\n {\n \"@type\": \"Country\",\n \"name\": \"CA\"\n }\n ]\n }\n },\n \"sameAs\": \"https://en.wikipedia.org/wiki/my_favorite_movie\",\n \"releasedEvent\": {\n \"@type\": \"PublicationEvent\",\n \"startDate\": \"2008-01-20\",\n \"location\": {\n \"@type\": \"Country\",\n \"name\": \"US\"\n }\n },\n \"description\": \"This is my favorite movie.\",\n \"actor\": [\n {\n \"@type\": \"Person\",\n \"name\": \"John Doe\",\n \"sameAs\": \"https://en.wikipedia.org/wiki/John_Doe\"\n },\n {\n \"@type\": \"Person\",\n \"name\": \"Jane Doe\",\n \"sameAs\": \"https://en.wikipedia.org/wiki/Jane_Doe\"\n }\n ],\n \"identifier\": [\n {\n \"@type\": \"PropertyValue\",\n \"propertyID\": \"IMDB_ID\",\n \"value\": \"tt0123456\"\n }\n ]\n }\n ]\n }\n ```\n\n### Validate the sample feed\n\nThe following tools are available to help you validate a sample feed with Google's structured data\nspecifications for media feeds.\n\n- **Data Feed Validation tool**\n\n The Data Feed Validation tool can validate a single entity at a time. Use this tool to validate a sample\n entity from your catalog for structural errors and common content errors. You can find more\n details about the tool [here](../tools/troubleshoot-using-the-data-feed-validation-tool).\n- **JSON Schema Validation tool**\n\n The JSON Schema Validation tool can validate all files in a feed. Use this tool during the\n development of the feed to avoid common structural errors. You can find more details about the\n tool [here](../tools/jsonschemas).\n\n### Create a production feed\n\n1. Once all the errors and warnings in the sample feed are resolved, expand the feed to include all the entities in your catalog.\n2. Use the [Data Feed Validation tool](https://actions.google.com/tools/feed-validator/u/0/) frequently to validate a small number of entities in your feed at a time (Pasting a large number of entities on the tool may freeze the web browser). Confirm that your feed includes all the entities in your catalog by comparing the number of entities in your feed with the number of items in your catalog."]]