Memigrasikan laporan persaingan harga

Dokumen ini membantu Anda bermigrasi dari laporan patokan harga, yang tidak akan digunakan lagi pada 1 September 2025, ke laporan persaingan harga baru.

Laporan persaingan harga baru menawarkan hal berikut:

Membandingkan skema tabel tolok ukur harga dan daya saing harga

Tabel berikut membantu Anda mengidentifikasi kolom di tabel Products_PriceBenchmarks yang memiliki pengganti yang setara di tabel PriceCompetitiveness_:

Tolok ukur harga (lama) Daya saing harga (baru)
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 atau _PARTITIONTIME

Selain itu, tabel PriceCompetitiveness_ berisi data tambahan tentang inventaris seperti judul, merek, jenis dan kategori produk, serta harga produk di inventaris penjual. Data ini memungkinkan Anda membandingkan dan menganalisis harga tolok ukur dengan harga Anda sendiri secara efektif.

Kolom tambahan berikut tersedia di tabel PriceCompetitiveness_ baru:

Kolom Deskripsi
title Judul produk.
brand Merek produk.
offer_id ID produk yang diberikan penjual.
price Harga produk.
price.amount_micros Harga item, dalam mikro (1 direpresentasikan sebagai 1000000).
price.currency_code Mata uang harga item.
product_type_l1 Atribut jenis produk produk.
product_type_l2 Atribut jenis produk produk.
product_type_l3 Atribut jenis produk produk.
product_type_l4 Atribut jenis produk produk.
product_type_l5 Atribut jenis produk dari produk.
category_l1 Kategori produk Google dari produk.
category_l2 Kategori produk Google dari produk.
category_l3 Kategori produk Google dari produk.
category_l4 Kategori produk Google dari produk.
category_l5 Kategori produk Google dari produk.

Daya saing harga dan tolok ukur harga tidak mendukung pengisian ulang. Fungsi ini selalu menampilkan data saat ini yang tersedia saat Anda meminta transfer.

Contoh kueri

Bagian ini menyoroti perubahan pada contoh kueri yang digunakan untuk mengambil data daya saing harga.

Contoh 1: Mengambil tolok ukur harga produk per negara

Kueri berikut menampilkan daftar tolok ukur harga produk per negara. Perhatikan bahwa produk dapat memiliki benchmark yang berbeda di berbagai negara.

Menggunakan tabel Products_PriceBenchmarks (lama)

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';

Menggunakan tabel PriceCompetitiveness (baru)

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';

Contoh 2: Mengambil produk dan tolok ukur terkait

Kueri berikut mengambil produk dan tolok ukur terkait.

Menggabungkan tabel Products dan PriceBenchmarks (lama)

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;

Menggunakan tabel PriceCompetitiveness (baru)

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';

Dalam kueri ini, ganti kode berikut:

  • DATASET: nama set data Anda
  • MERCHANT_ID: ID akun penjual
  • DATE: tanggal dalam format YYYY-MM-DD

Langkah berikutnya