Перенос отчетов из Content API for Shopping

Вот как можно интегрировать API Merchant Reports с существующей реализацией Content API for Shopping .

Запросы

Используйте следующий формат URL-адреса запроса для API Merchant Reports:

POST https://merchantapi.googleapis.com/reports/v1beta/{parent}/reports:search

Ниже приведен пример сравнения Content API для покупок с API Merchant Reports для search запросов:

API контента Торговый API
URL-адрес https://shoppingcontent.googleapis.com/content/v2.1/ {merchantId} /reports/search https://merchantapi.googleapis.com/reports/v1beta/ {parent} /reports:search
Идентификаторы {merchantId} {parent}

Методы

Вы можете запросить API отчетов о продавцах, вызвав метод ReportService.Search .

Взгляды

В Merchant API имена таблиц изменены с CammelCase на snake_case .

MerchantPerformanceView теперь называется product_performance_view .

Вот сопоставление имен таблиц в Content API for Shopping и Merchant API:

API контента Торговый API
MerchantPerformanceView product_performance_view
ProductView product_view
PriceCompetitivenesProductView price_competitiveness_product_view
PriceInsightsProductView price_insights_product_view
BestSellersBrandView best_sellers_brand_view
BestSellersProductClusterView best_sellers_product_cluster_view
CompetitiveVisibilityCompetitorView competitive_visibility_competitor_view
CompetitiveVisibilityTopMerchantView competitive_visibility_top_merchant_view
CompetitiveVisibilityBenchmarkView competitive_visibility_benchmark_view

В Merchant API указывать префикс поля, например, segments.offer_id , больше не требуется. Вместо этого просто используйте имя поля offer_id .

Ниже приведен пример сравнения запросов в Content API for Shopping и Merchant API:

API контента Торговый API
   SELECT
     segments.offer_id,
     metrics.clicks
   FROM MerchantPerformanceView
   WHERE segments.date DURING LAST_7_DAYS
   
   SELECT
     offer_id,
     clicks
   FROM product_performance_view
   WHERE date DURING LAST_7_DAYS
   

Вот пример ответа:

API контента Торговый API
{
  "segments":{
    "offerId":"abc"
  },
  "metrics":{
    "clicks":"123"
  }
}
{
  "productPerformanceView" : {
    "offerId": "abc",
    "clicks": "123"
  }
}

Имя таблицы можно использовать в качестве префикса поля. Например, в запросе Merchant API принимаются как offer_id , так и product_performance_view.offer_id .

Производительность

Вот что изменилось в представлении производительности в API Merchant Reports:

API контента Торговый API Описание
segments.program : строка marketing_method : строка сегмент program заменяется новым полем marketing_method . Подробности см. в разделе «Значения нового marketing method » .
metrics.ctr : двойной clickThroughRate : двойной Метрика ctr переименована в clickThroughRate .
metrics.conversionValueMicros : целое число
segments.currencyCode : строка
conversionValue: {
object (Price)
}
Поля микросуммы и валюты объединены в одно поле с типом Price
metrics.orders,
metrics.orderedItems,
Не поддерживается Метрики Buy On Google не поддерживаются в API Merchant Reports.

Ценности новых методов маркетинга

Вот сопоставление между значениями segments.program и marketing_method :

API контента Торговый API
SHOPPING_ADS ADS
FREE_PRODUCT_LISTING ORGANIC
FREE_LOCAL_PRODUCT_LISTING ORGANIC
BUY_ON_GOOGLE_LISTING Не поддерживается

Продукт

Вот что изменилось в представлении товаров в API Merchant Reports:

API контента Торговый API Описание
productView.id : строка id : строка Формат поля изменится с channel:language:targetCountry:offerId на
channel~language~feedLabel~offerId
productView.priceMicros : целое число
productView.currencyCode : строка
price: {
object (Price)
}
Поля микросуммы и валюты объединены в одно поле с типом Price
productView.aggregated_destination_status : строка aggregated_reporting_context_status : строка aggregated_destination_status переименовано aggregated_reporting_context_status , значения не изменились
productView.item_issues: [
{
object (ItemIssue)
}
]
item_issues: [
{
object (ItemIssue)
}
]
Определение ItemIssue изменилось.
Не поддерживается feedLabel : строка Добавлено feedLabel

Ценовая аналитика

Вот что изменилось в представлении ценовой информации в API Merchant Reports:

API контента Торговый API Описание
productView.id : строка id : строка Формат поля изменится с channel:language:targetCountry:offerId на channel~language~feedLabel~offerId
productView.priceMicros : целое число
productView.currencyCode : строка
price: {
object (Price)
}
Поля микросуммы и валюты объединены в одно поле с типом Price
priceInsights.suggestedPriceMicros : целое число
priceInsights.suggestedPriceCurrencyCode : строка
suggestedPrice: {
object (Price)
}
Поля микросуммы и валюты объединены в одно поле с типом Price
priceInsights.predictedGrossProfitChangeFraction : двойной
priceInsights.predictedMonthlyGrossProfitChangeMicros : целое число
priceInsights.predictedMonthlyGrossProfitChangeCurrencyCode : строка
Не поддерживается Поля, связанные с изменением валовой прибыли, не поддерживаются в API Merchant Reports.

Ценовая конкурентоспособность

Вот что изменилось в представлении ценовой конкурентоспособности в API Merchant Reports:

API контента Торговый API Описание
productView.id : строка id : строка Формат поля изменится с channel:language:targetCountry:offerId на channel~language~feedLabel~offerId
productView.priceMicros : целое число
productView.currencyCode : строка
price: {
object (Price)
}
Поля микросуммы и валюты объединены в одно поле с типом Price
priceCompetitiveness.countryCode : строка reportCountryCode : строка Поле countryCode переименовано в reportCountryCode .
priceCompetitiveness.benchmarkPriceMicros : целое число
priceCompetitiveness.benchmarkPriceCurrencyCode : строка
benchmarkPrice: {
object (Price)
}
Поля микросуммы и валюты объединены в одно поле с типом Price

Бестселлеры

Вот что изменилось в представлениях бестселлеров в API Merchant Reports:

API контента Торговый API Описание
bestSellers.countryCode : строка reportCountryCode : строка Поле countryCode переименовано в reportCountryCode .
bestSellers.categoryId : int reportCategoryId : int Поле categoryId переименовано в reportCategoryId .

Конкурентная видимость

Вот что изменилось в представлениях видимости конкурентов в API Merchant Reports:

API контента Торговый API Описание
competitiveVisibility.countryCode : строка reportCountryCode : строка Поле countryCode переименовано в reportCountryCode .
competitiveVisibility.categoryId : целое число reportCategoryId : целое число Поле categoryId переименовано в reportCategoryId .