[null,null,["最后更新时间 (UTC):2025-08-08。"],[[["\u003cp\u003eThe Merchant API provides performance reports that allow you to query metrics like clicks and impressions for specified date ranges using SQL-like syntax.\u003c/p\u003e\n"],["\u003cp\u003eReports can be segmented by product attributes (e.g., offer_id, brand) or event attributes (e.g., date, marketing_method) for granular analysis, similar to a SQL \u003ccode\u003eGROUP BY\u003c/code\u003e clause.\u003c/p\u003e\n"],["\u003cp\u003ePrice metrics, like \u003ccode\u003econversion_value\u003c/code\u003e, are returned in separate rows for each currency if available, potentially resulting in multiple rows for a single product or event.\u003c/p\u003e\n"],["\u003cp\u003eYou must specify the data to be returned in the \u003ccode\u003eSELECT\u003c/code\u003e clause, wildcards are not allowed, and segment fields require accompanying metrics to avoid errors.\u003c/p\u003e\n"],["\u003cp\u003eCategory and product type segments use a hierarchical structure, with each level returned in its own field, enabling detailed product performance analysis based on your inventory organization.\u003c/p\u003e\n"]]],["The Merchant API provides performance reports accessible via `product_performance_view`. Users query for specific metrics like `clicks` and `impressions` within a date range, using `SELECT` and `WHERE` clauses. Segments, including product and event attributes, allow data grouping, similar to SQL's `GROUP BY`. Reports can show clicks by date, marketing method, or offer ID. Category and product type can segment metrics. Price metrics are shown with multiple currencies, in separate rows. All selected fields are returned in the response, even if they have default or zero values.\n"],null,["# Performance reports\n\nThe Merchant API offers performance reports, for example\n[`product_performance_view`](/merchant/api/reference/rest/reports_v1/accounts.reports/search#productperformanceview).\nThis page explains the structure of performance reports.\n\nMetrics\n-------\n\nYou can query for metrics (for example, `clicks` and `impressions`) that you\nwant returned. You must add a filter on the date range to query the Reports\nservice for performance data.\n\nHere's a sample query that returns a single row, with the total number of clicks\nwithin the specified date range: \n\n SELECT clicks\n FROM product_performance_view\n WHERE date BETWEEN '2023-12-01' AND '2023-12-21'\n\nYou must specify the data you want returned. Wildcards (for example, `SELECT\n*`) return an error.\n\nThe following sample response shows that the merchant has had 4,440 total\nclicks, across all products, across all marketing methods, between December 1st,\n2023 and December 21st, 2023. \n\n {\n \"results\": [\n {\n \"productPerformanceView\": {\n \"clicks\": \"4,440\"\n }\n }\n ]\n }\n\n| **Key Point:** If you don't select any segments fields in your query, you only receive one row of metrics.\n\nSegments\n--------\n\nYou can use [segments\nfields](/merchant/api/guides/reports/query-language#segments) for\nsegmentation in [performance\nreports](/merchant/api/guides/reports/evaluate-products#measure_performance).\nFor example, querying for `marketing_method` returns a report with a row for\neach marketing method, and the\n[metrics](/merchant/api/guides/reports/query-language#metrics) that you\nspecify for that marketing method in the `SELECT` clause.\n\nSegments fields can be product attributes (for example, `offer_id`, `brand`, and\n`category`) or event attributes (for example `date` and `marketing_method`).\n\nSegments fields act similarly to a `GROUP BY` in SQL. Segments fields split the\nselected metrics, grouping by each segment in the `SELECT` clause.\n\nHere's a sample query that returns clicks per day, in descending order by\n`clicks`, within the added condition of a date range. Only rows where at least\none requested metric is non-zero are returned. \n\n SELECT\n date,\n clicks\n FROM product_performance_view\n WHERE date BETWEEN '2023-12-01' AND '2023-12-03'\n ORDER BY clicks DESC\n\nThe following sample response shows that the merchant had 1,546 clicks across\nall products, across all marketing methods, on December 1st, 2023, and 829\nclicks across all products, across all marketing methods, on December 2nd, 2023.\nThe merchant had no clicks on December 3rd, 2023, so nothing is returned for\nthat date. \n\n {\n \"results\": [\n {\n \"productPerformanceView\": {\n \"date\": {\n \"year\": 2023,\n \"month\": 12,\n \"day\": 1\n },\n \"clicks\": \"1546\"\n }\n },\n {\n \"productPerformanceView\": {\n \"date\": {\n \"year\": 2023,\n \"month\": 12,\n \"day\": 2\n },\n \"clicks\": \"829\"\n }\n }\n ]\n }\n\n| **Key Point:** You can only select specific segments fields if you also select metrics. If you don't select any metrics in your query, the Merchant Reports API returns an error.\n\nAs with custom reports in the Merchant Center, you can specify multiple segments\nin the same query with the Merchant Reports API.\n\nHere's a sample query that returns the clicks for all products in your account\nduring a 30-day period, segmented by `marketing_method` and `offer_id`: \n\n SELECT marketing_method, offer_id, clicks\n FROM product_performance_view\n WHERE date BETWEEN '2023-11-01' AND '2023-11-30'\n\nThe response from this query includes a row for each combination of `offer_id`\nand `marketing_method`, with the number of clicks for that combination: \n\n {\n \"results\": [\n {\n \"productPerformanceView\": {\n \"marketingMethod\": \"ADS\",\n \"offerId\": \"12345\",\n \"clicks\": \"38\"\n }\n },\n {\n \"productPerformanceView\": {\n \"marketingMethod\": \"ADS\",\n \"offerId\": \"12346\",\n \"clicks\": \"125\"\n }\n },\n {\n \"productPerformanceView\": {\n \"marketingMethod\": \"ORGANIC\",\n \"offerId\": \"12346\",\n \"clicks\": \"23\"\n }\n },\n {\n \"productPerformanceView\": {\n \"marketingMethod\": \"ADS\",\n \"offerId\": \"12347\",\n \"clicks\": \"8\"\n }\n },\n {\n \"productPerformanceView\": {\n \"marketingMethod\": \"ORGANIC\",\n \"offerId\": \"12347\",\n \"clicks\": \"3\"\n }\n }\n ]\n }\n\n| **Caution:** Since a new row is returned for each combination of segments fields in your `SELECT` clause, the total number of rows in your response increases exponentially with each additional segments field.\n\n### Category and product type\n\nThe [Merchant Center Query\nLanguage](/merchant/api/guides/reports/query-language) supports segmenting\nmetrics by two groups of attributes that you can define to organize your\ninventory:\n\nCategory levels\n: Categories from [Google's product\n taxonomy](//support.google.com/merchants/answer/6324436). Google might\n auto-assign the category to your product if none was provided, or further\n refine the provided category.\n\nProduct type levels\n: Product types that [you assign based on your\n categorization](//support.google.com/merchants/answer/6324406). Unlike the\n 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 [product\nspecification](//support.google.com/merchants/answer/7052112) separates each\nlevel 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 return each level in its own field:\n\n| Segment | Value |\n|-------------------|----------------------|\n| `product_type_l1` | `Home & Garden` |\n| `product_type_l2` | `Kitchen & Dining` |\n| `product_type_l3` | `Kitchen Appliances` |\n| `product_type_l4` | `Refrigerators` |\n\n### Currency and price metrics\n\nPrice metrics, such as `conversion_value`, are represented using the\n[`Price`](/merchant/api/reference/rest/Shared.Types/Price)\ntype. If the metric is available in multiple currencies, the value for each\ncurrency is returned in a separate row. For example, the following query: \n\n SELECT conversion_value\n FROM product_performance_view\n WHERE date = '2023-11-01'\n\nreturns the following results: \n\n {\n \"results\": [\n {\n \"productPerformanceView\": {\n \"conversionValue\": {\n \"amountMicros\": \"150000000\",\n \"currencyCode\": \"USD\"\n }\n }\n },\n {\n \"productPerformanceView\": {\n \"conversionValue\": {\n \"amountMicros\": \"70000000\",\n \"currencyCode\": \"CAD\"\n }\n }\n }\n ]\n }\n\nIf you request both price and non-price metrics in a query, price metrics are\nreturned in separate result rows from non-price metrics, one result row per\ncurrency code. For example, the following query: \n\n SELECT conversions, conversion_value\n FROM product_performance_view\n WHERE date = '2020-11-01'\n\nreturns the following response: \n\n {\n \"results\": [\n {\n \"productPerformanceView\": {\n \"conversions\": \"27\",\n \"conversionValue\": {\n \"amountMicros\": \"0\",\n \"currencyCode\": \"\"\n }\n }\n },\n {\n \"productPerformanceView\": {\n \"conversions\": \"0\",\n \"conversionValue\": {\n \"amountMicros\": \"150000000\",\n \"currencyCode\": \"USD\"\n }\n }\n },\n {\n \"productPerformanceView\": {\n \"conversions\": \"0\",\n \"conversionValue\": {\n \"amountMicros\": \"70000000\",\n \"currencyCode\": \"CAD\"\n }\n }\n }\n ]\n }\n\nAll fields you select are returned in the response, even if their value is still\nthe default value or zero.\n\nFor more information about the fields available for query, see [Fields in `productPerformanceView` table](/merchant/api/reference/rest/reports_v1/accounts.reports#ProductPerformanceView.FIELDS)."]]