تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
Reporting API
تتيح Reporting API للتاجر التفاعل مع بيانات الأداء آليًا من خلال "لغة طلبات البحث في Merchant Center". يشبه ذلك إمكانية
إنشاء تقارير مخصّصة
مباشرةً في Merchant Center. توفّر Reporting API المزايا التالية:
تتيح هذه الميزة للتجّار الكبار استيراد بيانات الأداء الخاصة ببيانات المنتجات إلى أنظمة التقارير الداخلية أو التابعة لجهات خارجية.
تتيح هذه الإذن للمستخدمين والشركاء الخارجيين ومجمّعي البيانات الذين يديرون حسابات على Merchant Center إمكانية الوصول إلى التقارير.
يمكن لمستخدمي واجهة برمجة التطبيقات تحديد بيانات الأداء التي يريدون استردادها في استجابة طلب البحث، مثل:
المقاييس المطلوب عرضها (على سبيل المثال: النقرات ومرّات الظهور)
السمات التي سيتم تقسيم البيانات على أساسها (مثلاً: OfferId أو Date)
الشروط التي يجب استيفاؤها (على سبيل المثال: النقرات > 100)
يمكن للغة طلب البحث في Reporting API أن تطلب من Content API for Shopping مقاييس الأداء (عدد النقرات ومرات الظهور)، ويمكن تقسيمها حسب سمات مختلفة (سمات الأحداث المُبلغ عنها، مثل البرنامج والتاريخ، وسمات المنتجات، مثل العلامة التجارية والفئة وما إلى ذلك)، وذلك باستخدام الطريقة Search في الخدمة Reports.
تكون نتيجة طلب البحث إلى خدمة Reports عبارة عن قائمة ReportRow
من العناصر، ويمثّل كل ReportRow قيم المقاييس المطلوبة
لشرائح الجمهور التي حدّدتها في طلب البحث. في حال عدم تحديد أي شرائح، يتم عرض صف واحد مع تجميع المقاييس على مستوى جميع الشرائح. بخلاف ذلك، إذا تم طلب أي شرائح مع المقاييس، سيعرض الرد صفًا واحدًا لكل مجموعة فريدة من شرائح الجمهور. يمكنك اختيار عدة شرائح وعدة مقاييس في طلب بحث واحد.
طلب البحث عن المقاييس
يمكنك طلب البحث عن المقاييس (النقرات ومرّات الظهور ونسبة النقر إلى الظهور وما إلى ذلك) التي تريد عرضها. يجب إضافة فلتر على النطاق الزمني للاستعلام عن خدمة التقارير. يعرِض نموذج طلب البحث أدناه صفًا واحدًا: المبلغ الإجمالي للنقرات ضمن الشرط المضاف لنطاق زمني.
يوضّح نموذج استجابة رمز JSON أدناه أنّ هذا التاجر تلقّى 4,440 نقرة
مجمّعة على مستوى جميع منتجاته وجميع وجهاته بين
1 كانون الأول (ديسمبر) 2020 و21 كانون الأول (ديسمبر) 2020.
{"results":[{"metrics":{"clicks":"4,440"}}]}
طلب البحث عن الشرائح
بالإضافة إلى المقاييس، يمكنك أيضًا طلب البحث عن شرائح، والتي يمكن أن تكون سمة خاصة بمنتج (offer_id أو brand أو category أو غير ذلك) أو سمة خاصة بحدث تم تسجيله (date أو program). والحدث المسجّل هو ظهور المنتج أو النقر عليه.
تعمل الشرائح بشكل مشابه GROUP BY في SQL. تقسّم الأقسام المقاييس المحدّدة، وتُجمّع حسب كل قسم في عبارة SELECT. يعرض طلب البحث النموذجي أدناه عدد النقرات في اليوم، مرتّبة حسب عدد النقرات تنازليًا ضمن الشرط المضاف الخاص بنطاق زمني. سيتم عرض الصفوف التي يكون فيها مقياس واحد على الأقل من المقاييس المطلوبة غير صفري.
يوضّح نموذج استجابة رمز JSON أدناه أنّ هذا التاجر تلقّى 1,546 نقرة على جميع منتجاته في جميع وجهاته في 1 كانون الأول (ديسمبر) 2020، و829 نقرة على جميع منتجاته في جميع وجهاته في 2 كانون الأول (ديسمبر) 2020. لن يتم عرض أي عنصر لتاريخ 3 ديسمبر 2020 لأنّ التاجر لم يتلقَّ أي نقرات في ذلك اليوم.
تاريخ التعديل الأخير: 2025-08-13 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-13 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eMerchant API is the new version of the Content API for Shopping and allows programmatic access to data.\u003c/p\u003e\n"],["\u003cp\u003eReporting API enables merchants to access performance data using Merchant Center Query Language, benefiting large merchants and third-party partners.\u003c/p\u003e\n"],["\u003cp\u003eAPI users can specify metrics, dimensions, and conditions for data retrieval within the \u003ccode\u003eSearch\u003c/code\u003e call.\u003c/p\u003e\n"],["\u003cp\u003eReporting API queries can be used to retrieve performance metrics and segments for analysis, however date filters are required.\u003c/p\u003e\n"],["\u003cp\u003eReturned data includes metrics aggregated by segments, with single-row responses when no segments are specified.\u003c/p\u003e\n"]]],["The Merchant API's Reporting API allows users to programmatically access performance data via the Merchant Center Query Language. Users specify desired metrics (e.g., clicks, impressions) and dimensions (e.g., date, offer ID) in queries. A date range filter is mandatory. Results are returned as `ReportRow` instances, showing metrics segmented as requested. If no segments are specified one row of metrics will be returned. Multiple segments and metrics can be requested together, but all wildcards will return an error.\n"],null,["Reporting API\n-------------\n\nThe Reporting API lets a merchant engage with their performance data\nprogrammatically through the Merchant Center Query Language. This is similar to\nthe ability to\n[create custom reports](//support.google.com/merchants/answer/9967959)\ndirectly in Merchant Center. The Reporting API has the following benefits:\n\n- Lets large merchants import performance data for product listings into their internal or third-party reporting systems.\n- Lets users, third-party partners, and aggregators who manage Merchant Center accounts access reporting.\n\nAPI users can specify which performance data they would like to retrieve in the\nSearch call response, such as:\n\n- Metrics to be returned (for example: Clicks, Impressions)\n- Dimensions in which to segment the data (for example: OfferId, Date)\n- Conditions which need to be met (for example: Clicks \\\u003e 100)\n\nThe Reporting API query language can query the Content API for Shopping for\nperformance metrics (clicks, impressions), possibly segmented by various\ndimensions (reported event attributes like program and date, and product\nattributes like brand, category, etc.), using the `Search` method on the\n`Reports` service.\n\nThe result from a query to the `Reports` service is a list of `ReportRow`\ninstances, with each `ReportRow` representing the values of requested metrics\nfor segments you specified in your query. If no segments are specified, a single\nrow is returned with metrics aggregated across all segments. Otherwise, if any\nsegments are requested alongside metrics, then the response shows one row for\neach unique segment tuple. It is possible to select multiple segments and\nmultiple metrics in a single query.\n| **Key Point:** If you have never advertised your products or shared them on free listings, you will have no associated metrics and be returned a results field that contains an empty array.\n\n### Query for metrics\n\nYou can query for metrics (Clicks, Impressions, CTR, etc.) that you want\nreturned. **You must add a filter on the date range to query the Reports\nservice.** The sample query below returns a single row: the aggregate amount\nof clicks within the added condition of a date range. \n\n SELECT metrics.clicks\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2020-12-01' AND '2020-12-21';\n\n| **Key Point:** You must be explicit about the data you want returned. Any wildcards (for example, `Select metrics.*`) will return an error.\n\n#### Sample response\n\nThe sample JSON code response below shows how this merchant has had 4,440 clicks\nsummed together across all their products across all their destinations between\nDecember 1st, 2020 and December 21st, 2020. \n\n {\"results\": [\n {\n \"metrics\": {\n \"clicks\": \"4,440\"\n }\n }\n ]}\n\n| **Key Point:** If you don't select any segments in your query, you will only be returned one row of metrics.\n\n### Query for segments\n\nAlongside metrics, you can also query for segments, which can be an attribute of\na product (`offer_id`, `brand`, `category`, etc.) or an attribute of a reported\nevent (`date`, `program`). A reported event is an impression or click for a\nproduct.\n\nSegments act similarly to a `GROUP BY` in SQL. Segments split the selected\nmetrics, grouping by each segment in the `SELECT` clause. The sample query below\nreturns clicks per day, ordered by clicks descending within the added condition\nof a date range. Only rows where at least one requested metric is non-zero will\nbe returned. \n\n SELECT\n segments.date,\n metrics.clicks\n FROM MerchantPerformanceView\n WHERE segments.date BETWEEN '2020-12-01' AND '2020-12-03'\n ORDER BY metrics.clicks DESC;\n\n#### Sample response\n\nThe sample JSON code response below shows how this merchant has had 1,546 clicks\nacross all their products across all their destinations on December 1st, 2020\nand 829 clicks across all their products across all their destinations on\nDecember 2nd, 2020. No object will be returned for December 3rd, 2020 since\nthe merchant had no clicks on that day. \n\n {\n \"results\": [\n {\n \"segments\": {\n \"date\": {\n \"year\": 2020,\n \"month\": 12,\n \"day\": 1\n }\n },\n \"metrics\": {\n \"clicks\": \"1546\"\n }\n },\n {\n \"segments\": {\n \"date\": {\n \"year\": 2020,\n \"month\": 12,\n \"day\": 2\n }\n },\n \"metrics\": {\n \"clicks\": \"829\"\n }\n }\n ]}\n\n| **Key Point:** Segments can only be selected if metrics are also selected. If you don't select any metrics in your query, you will be returned an error."]]