從 Content API for Shopping 遷移報表

以下說明如何整合 Merchant Reports API,與現有的 Content API for Shopping 整合。

要求數量

請使用以下 Merchant Reports API 要求網址格式:

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

以下是 Content API for Shopping 與 Merchant Reports API 的 search 要求比較範例:

Content API 商家 API
網址 https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/reports/search https://merchantapi.googleapis.com/reports/v1beta/{parent}/reports:search
ID {merchantId} {parent}

方法

您可以呼叫 ReportService.Search 方法,查詢 Merchant Reports API。

View

在 Merchant API 中,表格名稱已從 CammelCase 變更為 snake_case

MerchantPerformanceView 現在是 product_performance_view

以下為 Content API for Shopping 與 Merchant API 中的資料表名稱對應:

Content 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 的查詢比較範例:

Content 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
   

以下是回應範例:

Content API 商家 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 商家 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,
不支援 Merchant Reports API 不支援 Buy on Google 指標

新行銷方法價值

以下為 segments.programmarketing_method 值的對應:

Content API 商家 API
SHOPPING_ADS ADS
FREE_PRODUCT_LISTING ORGANIC
FREE_LOCAL_PRODUCT_LISTING ORGANIC
BUY_ON_GOOGLE_LISTING 不支援

產品

以下是 Merchant Reports API 中的產品檢視畫面異動內容:

Content 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 欄位

價格分析

Merchant Reports API 中的價格分析檢視畫面異動如下:

Content 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:字串
不支援 Merchant Reports API 不支援與毛利變化相關的欄位

價格競爭力

以下是 Merchant Reports API 中的價格競爭力檢視畫面異動:

Content 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 類型的欄位

暢銷商品

以下是 Merchant Reports API 中暢銷商品檢視畫面異動的內容:

Content API 商家 API 說明
bestSellers.countryCode:字串 reportCountryCode:字串 countryCode 欄位已重新命名為 reportCountryCode
bestSellers.categoryId:int reportCategoryId:int categoryId 欄位已重新命名為 reportCategoryId

競爭曝光率

以下是 Merchant Reports API 中的競爭曝光率檢視畫面異動:

Content API 商家 API 說明
competitiveVisibility.countryCode:字串 reportCountryCode:字串 countryCode 欄位已重新命名為 reportCountryCode
competitiveVisibility.categoryId:整數 reportCategoryId:整數 categoryId 欄位已重新命名為 reportCategoryId