يجب تحديد البيانات التي تريد عرضها. تعرِض أحرف البدل (مثل SELECT
*) خطأ.
يوضّح نموذج الردّ التالي أنّ التاجر حصل على 4,440 كليًا
نقرة على جميع المنتجات وجميع الطرق التسويقية بين 1
ديسمبر (كانون الأول) 2023 و21 كانون الأول (ديسمبر) 2023.
يمكنك استخدام حقول
الشرائح للقيام بالتحليل المتعلّق بالشرائح في تقارير
الأداء.
على سبيل المثال، يؤدي طلب البحث عن marketing_method إلى عرض تقرير يتضمّن صفًا لكل طريقة تسويق والمقاييس التي تحدّدها لطريقة التسويق هذه في عبارة SELECT.
يمكن أن تكون حقول الشرائح سمات منتجات (مثل offer_id وbrand و
category) أو سمات أحداث (مثل date وmarketing_method).
تعمل حقول الشرائح بشكل مشابه لـ GROUP BY في SQL. تقسم حقول الشرائح
المقاييس المحدّدة، مع التجميع حسب كلّ قسم في العبارة SELECT.
في ما يلي نموذج طلب بحث يعرض النقرات في اليوم بترتيب تنازلي حسب
clicks، ضمن الشرط المُضاف لنطاق زمني. لا يتم عرض سوى الصفوف التي يكون فيها قياس واحد على الأقل من المقاييس المطلوبة غير صفري.
يوضّح نموذج الردّ التالي أنّ التاجر سجّل 1,546 نقرة على
كل المنتجات، وعلى جميع الطرق التسويقية، في 1 كانون الأول (ديسمبر) 2023، و829
نقرًا على كل المنتجات، وعلى جميع الطرق التسويقية، في 2 كانون الأول (ديسمبر) 2023.
لم يتلقّ التاجر أي نقرات في 3 كانون الأول (ديسمبر) 2023، لذا لن يتم عرض أي بيانات ليوم
ذلك التاريخ.
الفئات من تصنيف
المنتجات من Google قد تحدّد Google تلقائيًا الفئة لمنتجك في حال عدم تقديم أي فئة، أو قد تصعّد عملية تحسين الفئة المقدّمة.
مستويات أنواع المنتجات
أنواع المنتجات التي تحدّدها استنادًا إلى
تصنيفك: على عكس
مستويات الفئات، لا تتوفّر مجموعة محدّدة مسبقًا من القيم المسموح بها.
يتم تنظيم سمتَي الفئة ونوع المنتج في تسلسل هرمي يضم
مستويات متعدّدة. تفصل مواصفات
المنتج بين كل
مستوى باستخدام الحرف >، ولكن يمكنك اختيار كل مستوى من التسلسل الهرمي
بشكل منفصل في التقارير.
على سبيل المثال، لنفترض أنّ هناك منتجًا يتضمّن مستويات أنواع المنتجات التالية:
يتم تمثيل مقاييس الأسعار، مثل conversion_value، باستخدام النوع
Price. إذا كان المقياس متاحًا بعملات متعدّدة، يتم عرض قيمة كل
عملة في صف منفصل. على سبيل المثال، طلب البحث التالي:
إذا طلبت المقاييس المتعلقة بالسعر وغير المتعلقة به في طلب بحث، يتم عرض مقاييس السعر
في صفوف نتائج منفصلة عن المقاييس غير المتعلقة بالسعر، وسيكون هناك صف نتيجة واحد لكل
رمز عملة. على سبيل المثال، طلب البحث التالي:
تاريخ التعديل الأخير: 2025-08-08 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 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)."]]