下面介绍了如何将 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 | Merchant API | |
网址 | https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/reports/search | https://merchantapi.googleapis.com/reports/v1beta/{parent}/reports:search |
标识符 | {merchantId}
|
{parent}
|
方法
您可以通过调用 ReportService.Search
方法来查询 Merchant Reports API。
观看次数
在 Merchant API 中,表名称从 CammelCase
更改为 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 :double
|
clickThroughRate :double
|
ctr 指标已重命名为 clickThroughRate
|
metrics.conversionValueMicros :整数
segments.currencyCode :字符串
|
conversionValue: {
|
金额微单位和货币字段合并为一个字段,类型为 Price
|
metrics.orders,
|
不支持 | Merchant Reports API 不支持“在 Google 上购买”指标 |
新的营销方式值
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 :整数
productView.currencyCode :字符串
|
price: {
|
金额微单位和货币字段合并为一个字段,类型为 Price
|
productView.aggregated_destination_status :字符串
|
aggregated_reporting_context_status :字符串
|
aggregated_destination_status 字段已重命名为 aggregated_reporting_context_status ,但值没有更改 |
productView.item_issues: [
|
item_issues: [
|
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: {
|
金额微单位和货币字段合并为一个字段,类型为 Price
|
priceInsights.suggestedPriceMicros :整数
priceInsights.suggestedPriceCurrencyCode :字符串
|
suggestedPrice: {
|
金额微单位和货币字段合并为一个字段,类型为 Price
|
priceInsights.predictedGrossProfitChangeFraction :double
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: {
|
金额微单位和货币字段合并为一个字段,类型为 Price
|
priceCompetitiveness.countryCode :字符串
|
reportCountryCode :字符串
|
countryCode 字段已重命名为 reportCountryCode
|
priceCompetitiveness.benchmarkPriceMicros :整数
priceCompetitiveness.benchmarkPriceCurrencyCode :字符串
|
benchmarkPrice: {
|
金额微单位和货币字段合并为一个字段,类型为 Price
|
畅销商品
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
|