Migrate reporting from the Content API for Shopping

Here's how you can integrate the Merchant Reports API with your existing Content API for Shopping implementation.

Requests

Use the following request URL format for the Merchant Reports API:

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

Here's a sample comparison of the Content API for Shopping to the Merchant Reports API for search requests:

Content API Merchant API
URL https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/reports/search https://merchantapi.googleapis.com/reports/v1beta/{PARENT}/reports:search
Identifiers {MERCHANT_ID} {PARENT}

Methods

You can query the Merchant Reports API by calling the ReportService.Search method.

Views

In the Merchant API, table names are changed from CammelCase to snake_case.

MerchantPerformanceView is now product_performance_view.

Here's a mapping between table names in the Content API for Shopping and the 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

In the Merchant API, specifying a field prefix, for example, segments.offer_id is no longer required. Instead, just use the field name, offer_id.

Here's a sample comparison of queries in the Content API for Shopping and the 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
   

Here's a sample response:

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

The table name can be used as a field prefix. For example, both offer_id and product_performance_view.offer_id are accepted in the Merchant API query.

Performance

Here's what's changed for the performance view in the Merchant Reports API:

Content API Merchant API Description
segments.program: string marketing_method: string program segment is replaced by a new marketing_method field. See the New marketing method values for details.
metrics.ctr: double clickThroughRate: double ctr metric is renamed to clickThroughRate
metrics.conversionValueMicros: integer
segments.currencyCode: string
conversionValue: {
object (Price)
}
Amount micros and currency fields are merged into one field with Price type
metrics.orders,
metrics.orderedItems,
Not supported Buy On Google metrics are not supported in the Merchant Reports API

New marketing method values

Here's the mapping between segments.program and marketing_method values:

Content API Merchant API
SHOPPING_ADS ADS
FREE_PRODUCT_LISTING ORGANIC
FREE_LOCAL_PRODUCT_LISTING ORGANIC
BUY_ON_GOOGLE_LISTING Not supported

Product

Here's what's changed for the product view in the Merchant Reports API:

Content API Merchant API Description
productView.id: string id: string The field format changes from channel:language:targetCountry:offerId to
channel~language~feedLabel~offerId
productView.priceMicros: integer
productView.currencyCode: string
price: {
object (Price)
}
Amount micros and currency fields are merged into one field with Price type
productView.aggregated_destination_status: string aggregated_reporting_context_status: string aggregated_destination_status field is renamed to aggregated_reporting_context_status, the values have not changed
productView.item_issues: [
{
object (ItemIssue)
}
]
item_issues: [
{
object (ItemIssue)
}
]
ItemIssue definition has changed
Not supported feedLabel: string feedLabel field is introduced

Price Insights

Here's what's changed for the price insights view in the Merchant Reports API:

Content API Merchant API Description
productView.id: string id: string The field format changes from channel:language:targetCountry:offerId to channel~language~feedLabel~offerId
productView.priceMicros: integer
productView.currencyCode: string
price: {
object (Price)
}
Amount micros and currency fields are merged into one field with Price type
priceInsights.suggestedPriceMicros: integer
priceInsights.suggestedPriceCurrencyCode: string
suggestedPrice: {
object (Price)
}
Amount micros and currency fields are merged into one field with Price type
priceInsights.predictedGrossProfitChangeFraction: double
priceInsights.predictedMonthlyGrossProfitChangeMicros: integer
priceInsights.predictedMonthlyGrossProfitChangeCurrencyCode: string
Not supported Fields related to gross profit change are not supported in the Merchant Reports API

Price Competitiveness

Here's what's changed for the price competitiveness view in the Merchant Reports API:

Content API Merchant API Description
productView.id: string id: string The field format changes from channel:language:targetCountry:offerId to channel~language~feedLabel~offerId
productView.priceMicros: integer
productView.currencyCode: string
price: {
object (Price)
}
Amount micros and currency fields are merged into one field with Price type
priceCompetitiveness.countryCode: string reportCountryCode: string countryCode field is renamed to reportCountryCode
priceCompetitiveness.benchmarkPriceMicros: integer
priceCompetitiveness.benchmarkPriceCurrencyCode: string
benchmarkPrice: {
object (Price)
}
Amount micros and currency fields are merged into one field with Price type

Best sellers

Here's what's changed for the best sellers views in the Merchant Reports API:

Content API Merchant API Description
bestSellers.countryCode: string reportCountryCode: string countryCode field is renamed to reportCountryCode
bestSellers.categoryId: int reportCategoryId: int categoryId field is renamed to reportCategoryId

Competitive visibility

Here's what's changed for the competitive visibility views in the Merchant Reports API:

Content API Merchant API Description
competitiveVisibility.countryCode: string reportCountryCode: string countryCode field is renamed to reportCountryCode
competitiveVisibility.categoryId: integer reportCategoryId: integer categoryId field is renamed to reportCategoryId