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.
Bạn có thể triển khai tính năng phân đoạn (có trong báo cáo tuỳ chỉnh của Merchant Center) trong Reporting API bằng cách thêm trường thích hợp vào một truy vấn. Ví dụ: việc truy vấn segments.program sẽ tạo ra một báo cáo có một hàng cho mỗi chương trình (Quảng cáo Mua sắm, Trang thông tin miễn phí về sản phẩm, v.v.) bao gồm các chỉ số (số lượt hiển thị, số lượt nhấp, v.v.) cho chương trình đó như được chỉ định trong mệnh đề SELECT.
Giống như báo cáo tuỳ chỉnh trong Merchant Center, bạn có thể chỉ định nhiều phân khúc trong cùng một truy vấn bằng Reporting API.
Truy vấn mẫu sau đây truy xuất số lượt nhấp cho tất cả sản phẩm trong tài khoản của bạn trong khoảng thời gian 30 ngày, được phân đoạn theo program và offer_id:
Nhấp vào Run (Chạy) để dùng thử mẫu trong API Explorer. Sau khi bạn nhấp vào Chạy, hãy cập nhật phần giữ chỗ mã người bán thành mã người bán của riêng bạn trong URL yêu cầu. Bạn có thể sửa đổi câu hỏi. Toàn bộ truy vấn phải nằm trên một dòng để hoạt động với trình khám phá API.
Kết quả của việc gửi truy vấn này đến reports.search là một hàng chỉ định số lượt nhấp cho mỗi tổ hợp offer_id và program, chẳng hạn như trong chuỗi JSON mẫu này:
Ngôn ngữ truy vấn Merchant Center hỗ trợ phân đoạn chỉ số theo 2 nhóm thuộc tính mà bạn có thể xác định để sắp xếp kho hàng:
Cấp danh mục (segments.category_l1, segments.category_l2, v.v.)
Danh mục trong cây phân loại sản phẩm của Google.
Google có thể tự động chỉ định danh mục cho sản phẩm của bạn nếu bạn không cung cấp danh mục hoặc tinh chỉnh thêm danh mục bạn cung cấp.
Cấp loại sản phẩm (segments.product_type_l1, segments.product_type_l2, v.v.)
Cả thuộc tính danh mục và loại sản phẩm đều được sắp xếp theo một hệ phân cấp có nhiều cấp. Quy cách sản phẩm phân tách từng cấp bằng ký tự >, nhưng bạn chọn riêng từng cấp của hệ phân cấp trong báo cáo.
Ví dụ: hãy xem xét một sản phẩm có các cấp loại sản phẩm sau:
Báo cáo sẽ trả về từng cấp trong trường riêng, như sau:
Phân đoạn
Giá trị
segments.product_type_l1
Home & Garden
segments.product_type_l2
Kitchen & Dining
segments.product_type_l3
Kitchen Appliances
segments.product_type_l4
Refrigerators
Chỉ số về đơn vị tiền tệ và giá
Trường segments.currency_code của ReportRow cho biết đơn vị tiền tệ mà các chỉ số về giá như metrics.conversion_value_micros được trả về.
Vì điều này rất quan trọng để diễn giải chính xác các chỉ số này, nên ReportRow được trả về sẽ tự động bao gồm segments.currency_code bất cứ khi nào bạn chọn một trong các chỉ số về giá bên dưới.
metrics.conversion_value_micros
metrics.aov_micros
metrics.ordered_item_sales_micros
metrics.returns_micros
metrics.shipped_item_sales_micros
Chỉ số của chương trình Mua trên Google
Ngôn ngữ truy vấn Merchant Center hỗ trợ 2 danh mục chỉ số cho đơn đặt hàng Mua trên Google: chỉ số ở cấp mặt hàng và chỉ số ở cấp đơn đặt hàng.
chỉ số ở cấp mặt hàng
Các chỉ số được tính dựa trên các mặt hàng trong đơn đặt hàng và được liên kết với phương diện sản phẩm của các mặt hàng trong mỗi đơn đặt hàng.
metrics.item_days_to_ship
metrics.item_fill_rate
metrics.ordered_items
metrics.ordered_item_sales_micros
metrics.rejected_items
metrics.returned_items
metrics.return_rate
metrics.returns_micros
metrics.shipped_items
metrics.shipped_item_sales_micros
metrics.unshipped_items
chỉ số ở cấp đơn đặt hàng
Các chỉ số được tính trên cơ sở mỗi đơn đặt hàng.
metrics.aos
metrics.aov_micros
metrics.days_to_ship
metrics.orders
metrics.shipped_orders
metrics.unshipped_orders
Các chỉ số ở cấp đơn đặt hàng không được liên kết với phương diện sản phẩm của các mặt hàng trong mỗi đơn đặt hàng.
Bạn có thể chọn các chỉ số ở cấp mặt hàng kết hợp với mọi phân khúc có sẵn.
Tuy nhiên, việc chọn chỉ số ở cấp đơn đặt hàng kết hợp với bất kỳ phân khúc phương diện sản phẩm nào sau đây sẽ không thành công:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-13 UTC."],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and offers improved integration capabilities.\u003c/p\u003e\n"],["\u003cp\u003eUse the Reporting API to segment your product data by attributes such as program, offer ID, category, and product type, allowing for granular performance analysis.\u003c/p\u003e\n"],["\u003cp\u003eCurrency and price metrics are automatically included in reports to ensure accurate interpretation of financial data.\u003c/p\u003e\n"],["\u003cp\u003eBuy on Google metrics are no longer supported and return 0 values.\u003c/p\u003e\n"],["\u003cp\u003eItem-level Buy on Google metrics can be segmented by any available segment, while order-level metrics have restrictions with certain product dimensions.\u003c/p\u003e\n"]]],["The Merchant API's beta version is introduced, replacing the Content API for Shopping. The Reporting API allows segmentation of custom reports by adding fields to a query, such as `segments.program`. A sample query retrieves clicks segmented by `program` and `offer_id`. Product attributes can be categorized using Google's taxonomy (`segments.category_l1`, etc.) or custom types (`segments.product_type_l1`, etc.). Price metrics utilize `segments.currency_code`. Buy on Google metrics are deprecated. The documentation provides a full list of segments.\n"],null,["# Segmentation, available in Merchant Center\n[custom reports](//support.google.com/merchants/answer/9967959), can be\nimplemented in the Reporting API by adding the appropriate field to a query. For\nexample, querying for `segments.program` results in a report with a row for each\nprogram (Shopping Ads, Free product listings, etc.) that includes the metrics\n(impressions, clicks, etc.) for that program as specified in the `SELECT`\nclause.\n\nAs with custom reports in the Merchant Center, you can specify multiple segments\nin the same query with the Reporting API.\n\nThe following sample query retrieves the clicks for all products in your account\nduring a 30-day period, segmented by `program` and `offer_id`: \n\n SELECT\n segments.program,\n segments.offer_id,\n metrics.clicks\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2020-11-01' AND '2020-11-30'\n\n[Run](https://developers.google.com/shopping-content/reference/rest/v2.1/reports/search?apix=true&apix_params=%7B%22merchantId%22%3A0%2C%22resource%22%3A%7B%22query%22%3A%22SELECT%20%20segments.program%2C%20%20segments.offer_id%2C%20%20metrics.clicks%20FROM%20MerchantPerformanceView%20WHERE%20segments.date%20BETWEEN%20%272020-11-01%27%20AND%20%272020-11-30%27%22%7D%7D)\n\nClick **Run** to try the sample in the **API Explorer** . After you click\n**Run** , update the merchant ID placeholder to your own merchant ID in the\nrequest URL. You can modify the query. The full query must remain on one line to\nwork with the **API explorer**.\n\nThe results from sending this query to `reports.search` is a row specifying the\nclicks for each combination of `offer_id` and `program`, like in this sample\nJSON string: \n\n {\n \"results\": [\n {\n \"segments\": {\n \"program\": \"SHOPPING_ADS\",\n \"offerId\": \"12345\"\n },\n \"metrics\": {\n \"clicks\": \"38\"\n }\n },\n {\n \"segments\": {\n \"program\": \"SHOPPING_ADS\",\n \"offerId\": \"12346\"\n },\n \"metrics\": {\n \"clicks\": \"125\"\n }\n },\n {\n \"segments\": {\n \"program\": \"FREE_PRODUCT_LISTING\",\n \"offerId\": \"12346\"\n },\n \"metrics\": {\n \"clicks\": \"23\"\n }\n },\n {\n \"segments\": {\n \"program\": \"SHOPPING_ADS\",\n \"offerId\": \"12347\"\n },\n \"metrics\": {\n \"clicks\": \"8\"\n }\n },\n {\n \"segments\": {\n \"program\": \"FREE_PRODUCT_LISTING\",\n \"offerId\": \"12347\"\n },\n \"metrics\": {\n \"clicks\": \"3\"\n }\n }\n ]\n }\n\n| **Caution:** Keep in mind that the number of rows can increase exponentially for each additional segment field included in your report query.\n\nCategory and product type\n-------------------------\n\nThe Merchant Center Query Language supports segmenting metrics by two groups of\nattributes that you can define to organize your inventory:\n\nCategory levels (`segments.category_l1`, `segments.category_l2`, etc.)\n: Categories from\n [Google's product taxonomy](//support.google.com/merchants/answer/6324436).\n Google might auto-assign the category to your product if none was provided, or\n further refine the provided category.\n\nProduct type levels (`segments.product_type_l1`, `segments.product_type_l2`, etc.)\n: Product types that\n [you assign based on your categorization](//support.google.com/merchants/answer/6324406).\n Unlike the category levels, there is no predefined set of supported values.\n\nBoth the category and product type attributes are organized in a hierarchy with\nmultiple levels. The\n[product specification](//support.google.com/merchants/answer/7052112) separates\neach level with the `\u003e` character, but you select each level of the hierarchy\nseparately in reports.\n\nFor example, consider a product with the following product type levels: \n\n Home & Garden \u003e Kitchen & Dining \u003e Kitchen Appliances \u003e Refrigerators\n\nReports will return each level in its own field, as follows:\n\n| Segment | Value |\n|----------------------------|----------------------|\n| `segments.product_type_l1` | `Home & Garden` |\n| `segments.product_type_l2` | `Kitchen & Dining` |\n| `segments.product_type_l3` | `Kitchen Appliances` |\n| `segments.product_type_l4` | `Refrigerators` |\n\nCurrency and price metrics\n--------------------------\n\nThe `segments.currency_code` field of a `ReportRow` indicates the currency in\nwhich price metrics such as `metrics.conversion_value_micros` are returned.\nSince this is important in order to properly interpret these metrics, the\nreturned `ReportRow` will automatically include `segments.currency_code`\nwhenever you select one of the price metrics below.\n\n- `metrics.conversion_value_micros`\n\n| **Deprecated:** The following fields are no longer supported.\n\n- `metrics.aov_micros`\n- `metrics.ordered_item_sales_micros`\n- `metrics.returns_micros`\n- `metrics.shipped_item_sales_micros`\n\n| **Note:** You might still want to explicitly include `segments.currency_code` in your query for clarity and consistency between your `SELECT` clause and each `ReportRow` in the response.\n\nBuy on Google metrics\n---------------------\n\n| **Deprecated:** Buy on Google metrics are no longer supported and retrieving them returns 0 starting from May 2024 (including historical values for past dates).\n\nThe Merchant Center Query Language supports two categories of metrics for Buy on\nGoogle orders: item-level metrics and order-level metrics.\n\nitem-level metrics\n\n: Metrics calculated based on the items within orders, and associated with the\n product dimensions of the items in each order.\n\n - `metrics.item_days_to_ship`\n - `metrics.item_fill_rate`\n - `metrics.ordered_items`\n - `metrics.ordered_item_sales_micros`\n - `metrics.rejected_items`\n - `metrics.returned_items`\n - `metrics.return_rate`\n - `metrics.returns_micros`\n - `metrics.shipped_items`\n - `metrics.shipped_item_sales_micros`\n - `metrics.unshipped_items`\n\norder-level metrics\n\n: Metrics calculated on a per-order basis.\n\n - `metrics.aos`\n - `metrics.aov_micros`\n - `metrics.days_to_ship`\n - `metrics.orders`\n - `metrics.shipped_orders`\n - `metrics.unshipped_orders`\n\n: Order-level metrics are *not* associated with the product dimensions of the\n items in each order.\n\nYou can select item-level metrics in combination with any available segment.\nHowever, selecting order-level metrics in combination with any of the following\nproduct dimension segments will fail:\n\n- `segments.brand`\n- `segments.category_l1`, `segments.category_l2`, `segments.category_l3`, `segments.category_l4`, `segments.category_l5`\n- `segments.custom_label1`, `segments.custom_label2`, `segments.custom_label3`, `segments.custom_label4`, `segments.custom_label5`\n- `segments.offer_id`\n- `segments.product_type_l1`, `segments.product_type_l2`, `segments.product_type_l3`, `segments.product_type_l4`, `segments.product_type_l5`\n- `segments.title`\n\nFind out more\n-------------\n\nFor a complete list of segments, check out the\n[documentation](/shopping-content/reference/rest/v2.1/reports/search#segments)."]]