Content API for Shopping からレポートを移行する

Merchant Reports API を既存の Content API for Shopping 実装と統合する方法は次のとおりです。

リクエスト

Merchant Reports API の場合は、次のリクエスト URL 形式を使用します。

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

以下に、search リクエストに関して Content API for Shopping と Merchant Reports API を比較した例を示します。

Content API Merchant API
URL https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/reports/search https://merchantapi.googleapis.com/reports/v1beta/{parent}/reports:search
ID {merchantId} {parent}

Methods

Merchant Reports API に対してクエリを実行するには、ReportService.Search メソッドを呼び出します。

視聴回数

Merchant API では、テーブル名が CammelCase から snake_case に変更されます。

MerchantPerformanceViewproduct_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_idproduct_performance_view.offer_id の両方を使用できます。

パフォーマンス

Merchant Reports API のパフォーマンス ビューの変更点は次のとおりです。

Content API Merchant API 説明
segments.program: 文字列 marketing_method: 文字列 program セグメントが新しい marketing_method フィールドに置き換えられます。詳細については、新しい marketing methodをご覧ください。
metrics.ctr: double clickThroughRate: double ctr 指標の名前が clickThroughRate に変更されました。
metrics.conversionValueMicros: 整数
segments.currencyCode: 文字列
conversionValue: {
object (Price)
}
金額のマイクロフィールドと通貨フィールドを、Price 型の 1 つのフィールドに統合しました。
metrics.orders,
metrics.orderedItems,
サポート対象外 「Google で購入」の指標は Merchant Reports API ではサポートされていません

新しいマーケティング方法の値

segments.programmarketing_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: 整数
productView.currencyCode: 文字列
price: {
object (Price)
}
金額のマイクロフィールドと通貨フィールドを、Price 型の 1 つのフィールドに統合しました。
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: 整数
productView.currencyCode: 文字列
price: {
object (Price)
}
金額のマイクロフィールドと通貨フィールドを、Price 型の 1 つのフィールドに統合しました。
priceInsights.suggestedPriceMicros: 整数
priceInsights.suggestedPriceCurrencyCode: 文字列
suggestedPrice: {
object (Price)
}
金額のマイクロフィールドと通貨フィールドを、Price 型の 1 つのフィールドに統合しました。
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: 整数
productView.currencyCode: 文字列
price: {
object (Price)
}
金額のマイクロフィールドと通貨フィールドを、Price 型の 1 つのフィールドに統合しました。
priceCompetitiveness.countryCode: 文字列 reportCountryCode: 文字列 countryCode フィールドの名前が reportCountryCode に変更されました。
priceCompetitiveness.benchmarkPriceMicros: 整数
priceCompetitiveness.benchmarkPriceCurrencyCode: 文字列
benchmarkPrice: {
object (Price)
}
金額のマイクロフィールドと通貨フィールドを、Price 型の 1 つのフィールドに統合しました。

ベストセラー

Merchant Reports API のベストセラー ビューに関する変更点は次のとおりです。

Content API Merchant API 説明
bestSellers.countryCode: 文字列 reportCountryCode: 文字列 countryCode フィールドの名前が reportCountryCode に変更されました。
bestSellers.categoryId: 整数 reportCategoryId: 整数 categoryId フィールドの名前が reportCategoryId に変更されました。

競合視認性

Merchant Reports API の競合視認性ビューの変更点は次のとおりです。

Content API Merchant API 説明
competitiveVisibility.countryCode: 文字列 reportCountryCode: 文字列 countryCode フィールドの名前が reportCountryCode に変更されました。
competitiveVisibility.categoryId: 整数 reportCategoryId: 整数 categoryId フィールドの名前が reportCategoryId に変更されました。