Как перенести отчеты из Content API for Shopping

Merchant Reports API позволяет получать данные о товарах, их эффективности и конкурентной среде в Google.

Merchant Reports API позволяет:

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

Запросы

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

POST https://merchantapi.googleapis.com/reports/v1/{PARENT}/reports:search

Ниже приведено сравнение Content API for Shopping и Merchant Reports API для запросов search.

Content API Merchant API
URL https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/reports/search https://merchantapi.googleapis.com/reports/v1/{PARENT}/reports:search
Идентификаторы {MERCHANT_ID} {PARENT}

Методы

Чтобы отправить запрос к Merchant Reports API, вызовите метод ReportService.Search.

Просмотры

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

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

Ниже приведено сопоставление названий таблиц в Content API for Shopping и Merchant API.

Content API Merchant 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.

Content API Merchant 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
   

Пример ответа:

Content API Merchant API
{
  "segments":{
    "offerId":"abc"
  },
  "metrics":{
    "clicks":"123"
  }
}
{
  "productPerformanceView" : {
    "offerId": "abc",
    "clicks": "123"
  }
}

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

Эффективность

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

Content API Merchant API Описание
segments.program: строка marketing_method: строка Сегмент program заменен новым полем marketing_method. Подробные сведения приведены в разделе Новые значения marketing method.
metrics.ctr: дабл clickThroughRate: дабл Показатель "ctr" переименован в "clickThroughRate".
metrics.conversionValueMicros: integer
segments.currencyCode: string
conversionValue: {
object (Price)
}
Поля "Сумма в микроединицах" и "Валюта" объединены в одно поле с типом Price.
metrics.orders,
metrics.orderedItems,
…
Не поддерживаются Показатели программы "Купить через Google" не поддерживаются в Merchant Reports API.

Новые значения методов маркетинга

Ниже приведено сопоставление значений segments.program и marketing_method.

Content API Merchant API
SHOPPING_ADS ADS
FREE_PRODUCT_LISTING ORGANIC
FREE_LOCAL_PRODUCT_LISTING ORGANIC
BUY_ON_GOOGLE_LISTING Не поддерживаются

Товар

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

Content API Merchant API Описание
productView.id: строка id: строка Формат поля изменится с channel:language:targetCountry:offerId на
.channel~language~feedLabel~offerId
productView.priceMicros: integer
productView.currencyCode: string
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.

Информация о ценах

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

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

Конкурентоспособность цен

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

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

Лидеры продаж

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

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

Видимость по сравнению с конкурентами

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

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