迁移价格竞争力报告

本文档可帮助您从将于 2025 年 9 月 1 日弃用的价格基准报告迁移到新的价格竞争力报告。

新版价格竞争力报告提供以下信息:

比较价格基准表架构和价格竞争力表架构

下表可帮助您确定 Products_PriceBenchmarks中在 PriceCompetitiveness_中有等效替代项的字段:

价格基准(旧版) 价格竞争力(新)
product_id id
merchant_id merchant_id
aggregator_id aggregator_id
country_of_sale report_country_code
price_benchmark_value benchmark_price.amount_micros
price_benchmark_currency benchmark_price.currency_code
price_benchmark_timestamp _PARTITIONDATE_PARTITIONTIME

此外,PriceCompetitiveness_ 表还包含有关商品目录的其他数据,例如商品名、品牌、商品类型和类别,以及商家商品目录中的商品价格。借助这些数据,您可以有效地将基准价格与自己的价格进行比较和分析。

新版 PriceCompetitiveness_中提供了以下额外字段:

字段 说明
title 商品的名称。
brand 商品的品牌。
offer_id 商家提供的商品 ID
price 商品的价格。
price.amount_micros 商品的价格,以微单位表示(1 表示为 1000000)。
price.currency_code 商品的价格采用的币种。
product_type_l1 商品的商品类型属性
product_type_l2 商品的商品类型属性
product_type_l3 商品的商品类型属性
product_type_l4 商品的商品类型属性
product_type_l5 商品的商品类型属性
category_l1 商品的 Google 商品类别
category_l2 商品的 Google 商品类别
category_l3 商品的 Google 商品类别
category_l4 商品的 Google 商品类别
category_l5 商品的 Google 商品类别

价格竞争力和价格基准不支持回填。当您请求转移数据时,它们始终会返回当前可用的数据。

示例查询

本部分重点介绍了用于检索价格竞争力数据的示例查询中的变化。

示例 1:检索每个国家/地区的商品价格基准

以下查询会返回每个国家/地区的商品价格基准列表。请注意,同一产品在不同国家/地区的基准可能会有所不同。

使用 Products_PriceBenchmarks 表格(旧版)

SELECT
  DATE(price_benchmark_timestamp) AS date,
  product_id,
  merchant_id,
  aggregator_id,
  country_of_sale,
  price_benchmark_value,
  price_benchmark_currency
FROM
  `DATASET.Products_PriceBenchmarks_MERCHANT_ID`
WHERE
  _PARTITIONDATE >= 'DATE';

使用 PriceCompetitiveness 表格(新)

SELECT
  _PARTITIONDATE AS date,
  id,
  merchant_id,
  aggregator_id,
  report_country_code,
  benchmark_price.amount_micros,
  benchmark_price.currency_code
FROM
  `DATASET.PriceCompetitiveness_MERCHANT_ID`
WHERE
  _PARTITIONDATE >= 'DATE';

示例 2:检索商品和关联的基准

以下查询会检索商品及其关联的基准。

联接 ProductsPriceBenchmarks 表(旧)

WITH products AS (
  SELECT
    _PARTITIONDATE AS date,
    *
  FROM
    `DATASET.Products_MERCHANT_ID`
  WHERE
    _PARTITIONDATE >= 'DATE'
), benchmarks AS (
  SELECT
    _PARTITIONDATE AS date,
    *
  FROM
    `DATASET.Products_PriceBenchmarks_MERCHANT_ID`
  WHERE
    _PARTITIONDATE >= 'DATE'
)
SELECT
  products.date,
  products.product_id,
  products.merchant_id,
  products.aggregator_id,
  products.price,
  benchmarks.price_benchmark_value,
  benchmarks.price_benchmark_currency,
  benchmarks.country_of_sale
FROM
  products
INNER JOIN
  benchmarks
ON products.product_id = benchmarks.product_id
  AND products.merchant_id = benchmarks.merchant_id
  AND products.date = benchmarks.date;

使用 PriceCompetitiveness 表格(新)

SELECT
  _PARTITIONDATE AS date,
  id AS product_id,
  merchant_id,
  aggregator_id,
  price.amount_micros,
  price.currency_code,
  benchmark_price.amount_micros,
  benchmark_price.currency_code,
  report_country_code AS country_of_sale
FROM
  `DATASET.PriceCompetitiveness_MERCHANT_ID`
WHERE
  _PARTITIONDATE >= 'DATE';

在这些查询中,替换以下内容:

  • DATASET:您的数据集的名称。
  • MERCHANT_ID:商家账号 ID
  • DATE:日期,格式为 YYYY-MM-DD

后续步骤