Bestsellerbericht migrieren

In diesem Dokument erfahren Sie, wie Sie von der älteren Version der Bestsellerberichte zur neueren Version migrieren. Die ältere Version des Berichts, die die Tabellen BestSellers_TopBrands_, BestSellers_TopProducts_ und BestSellers_TopProducts_Inventory_ exportiert, wird am 1. September 2025 eingestellt.

Der neue Bestsellerbericht bietet folgende Vorteile:

Tabellen, die aus alten und neuen Berichten exportiert wurden

In der folgenden Tabelle werden die Tabellen verglichen, die mit den alten und neuen Berichten exportiert wurden:

Alter Bericht Neuer Bericht
BestSellers_TopBrands BestSellersBrandWeekly und BestSellersBrandMonthly
BestSellers_TopProducts BestSellersProductClusterWeekly und BestSellersProductClusterMonthly
BestSellers_TopProducts_Inventory BestSellersEntityProductMapping

Der alte Bericht enthält eine einzelne Zusammenfassung von Bestsellerdaten über einen nicht angegebenen Zeitraum. Der neue Bericht enthält sowohl die neuesten wöchentlichen als auch die monatlichen Aggregationen dieser Daten zum Zeitpunkt der Anfrage.

BestSellers_TopBrands mit BestSellersBrandWeekly und BestSellersBrandMonthly vergleichen

In der folgenden Tabelle finden Sie Felder in der Tabelle BestSellers_TopBrands, die in den Tabellen BestSellersBrandWeekly und BestSellersBrandMonthly durch entsprechende Felder ersetzt werden. Für einige Felder aus der alten Tabelle sind keine Ersatzfelder verfügbar.

BestSellers_TopBrands (alt) BestSellersBrandWeekly und BestSellersBrandMonthly (neu)
rank_timestamp _PARTITIONDATE und _PARTITIONTIME
brand brand
google_brand_id
ranking_category category_id
ranking_category_path.locale
ranking_category_path.name
ranking_country country_code
rank_id
rank rank
previous_rank previous_rank
relative_demand.bucket relative_demand
relative_demand.min
relative_demand.max
previous_relative_demand.bucket previous_relative_demand
previous_relative_demand.min
previous_relative_demand.max
relative_demand_change

BestSellers_TopProducts mit BestSellersProductClusterWeekly und BestSellersProductClusterMonthly vergleichen

In der folgenden Tabelle finden Sie Felder in der Tabelle BestSellers_TopProducts, die in den Tabellen BestSellersProductClusterWeekly und BestSellersProductClusterMonthly durch entsprechende Felder ersetzt werden. Für einige Felder aus der alten Tabelle sind keine Ersatzfelder verfügbar.

BestSellers_TopProducts (alt) BestSellersProductClusterWeekly und BestSellersProductClusterMonthly (neu)
rank_timestamp _PARTITIONDATE und _PARTITIONTIME
rank_id entity_id
rank rank
previous_rank previous_rank
ranking_country country_code
ranking_category report_category_id
ranking_category_path.locale
ranking_category_path.name
relative_demand.bucket relative_demand
relative_demand.min
relative_demand.max
previous_relative_demand.bucket previous_relative_demand
previous_relative_demand.min
previous_relative_demand.max
relative_demand_change
product_title.locale
product_title.name title (einzelner Titel anstelle eines Arrays für jede Sprache)
gtins variant_gtins
google_brand_id
brand brand
google_product_category
category_l1: category_l2, category_l3, category_l4, category_l5
google_product_category_path.locale
google_product_category_path.name
price_range.min price_range.min_amount_micros
price_range.max price_range.max_amount_micros
price_range.currency price_range.currency_code
product_inventory_status
brand_inventory_status

Inventarzuordnung von Bestsellerdaten

Im alten Bestsellerbericht werden die Bestsellerdaten in einer neu generierten Tabelle mithilfe der Spalte rank_id aus der Tabelle TopProducts den Inventardaten des Händlers zugeordnet.

Im neuen Bestsellerbericht wird die Spalte entity_id in die Tabellen BestSellersProductCluster exportiert. Diese werden in der Tabelle BestSellersEntityProductMapping allen Produkt-IDs aus dem Inventar des Händlers zugeordnet.

BestSellers_TopProductsInventory (alt) BestSellersEntityProductMapping (neu)
rank_id (in BestSellers_TopProducts gefunden) entity_id (in den Tabellen BestSellersProductClustersWeekly und BestSellersProductClustersMonthly)
product_id product_id
merchant_id
aggregator_id

Beispielabfragen

In diesem Abschnitt werden Änderungen an Beispielabfragen hervorgehoben, mit denen Bestsellerdaten abgerufen werden.

Beispiel 1: Top-Produkte für eine bestimmte Kategorie und ein bestimmtes Land abrufen

Die folgenden Abfragen geben die Top-Produkte für eine bestimmte Kategorie und ein bestimmtes Land zurück.

BestSellers_TopProducts-Tabelle (alt) verwenden

SELECT
  rank,
  previous_rank,
  relative_demand.bucket,
  (SELECT name FROM top_products.product_title WHERE locale = 'en-US') AS product_title,
  brand,
  price_range,
  google_product_category
FROM
  `DATASET.BestSellers_TopProducts_MERCHANT_ID` AS top_products
WHERE
  _PARTITIONDATE = 'DATE' AND
  ranking_category = 267 /*Smartphones*/ AND
  ranking_country = 'US'
ORDER BY
  rank;

Tabelle BestSellersProductClusterWeekly oder BestSellersProductClusterMonthly verwenden (neu)

SELECT
  rank,
  previous_rank,
  relative_demand,
  title AS product_title,
  brand,
  price_range,
  category_l1,
  category_l2
FROM
  `DATASET.BestSellersProductClusterWeekly_MERCHANT_ID` AS top_products
WHERE
  _PARTITIONDATE = 'DATE' AND
  report_category_id = 267 /*Smartphones*/ AND
  country_code = 'US'
ORDER BY
  rank;

Beispiel 2: Top-Produkte in Ihrem Inventar abrufen

Die folgenden Abfragen geben eine Liste der Top-Produkte in Ihrem Inventar zurück.

BestSellers_TopProducts-Tabelle (alt) verwenden

WITH latest_top_products AS
(
  SELECT
    *
  FROM
    `DATASET.BestSellers_TopProducts_MERCHANT_ID`
  WHERE
    _PARTITIONDATE = 'DATE'
),
latest_top_products_inventory AS
(
  SELECT
    *
  FROM
    `DATASET.BestSellers_TopProducts_Inventory_MERCHANT_ID`
  WHERE
    _PARTITIONDATE = 'DATE'
)
SELECT
  top_products.rank,
  inventory.product_id,
  (SELECT ANY_VALUE(name) FROM top_products.product_title) AS product_title,
  top_products.brand,
  top_products.gtins
FROM
  latest_top_products AS top_products
INNER JOIN
  latest_top_products_inventory AS inventory
USING (rank_id);

Tabelle BestSellersProductClusterWeekly oder BestSellersProductClusterMonthly verwenden (neu)

WITH latest_top_products AS
(
  SELECT
    *
  FROM
    `DATASET.BestSellersProductClusterWeekly_MERCHANT_ID`
  WHERE
    _PARTITIONDATE = 'DATE'
),
latest_top_products_inventory AS
(
  SELECT
    *
  FROM
    `DATASET.BestSellersEntityProductMapping_MERCHANT_ID`
  WHERE
    _PARTITIONDATE = 'DATE'
)
SELECT
  top_products.rank,
  inventory.product_id,
  top_products.title AS product_title,
  top_products.brand,
  top_products.variant_gtins
FROM
  latest_top_products AS top_products
INNER JOIN
  latest_top_products_inventory AS inventory
USING (entity_id);

Wenn Sie die Anzahl der meistverkauften Produkte oder Marken in Ihrem Inventar ermitteln möchten, führen Sie eine Abfrage in den Tabellen BestSellerProductClusterWeekly oder BestSellerProductClusterMonthly mithilfe der Spalten product_inventory_status oder brand_inventory_status aus. Hier ein Beispiel für eine Suchanfrage:

SELECT
  *
FROM
  `DATASET.BestSellersProductClusterMonthly_MERCHANT_ID`
WHERE
  _PARTITIONDATE = 'DATE' AND
  product_inventory_status != 'NOT_IN_INVENTORY'
ORDER BY
  rank;

Beispiel 3: Top-Marken für eine bestimmte Kategorie und ein bestimmtes Land abrufen

Die folgenden Abfragen geben eine Liste der Top-Marken für eine bestimmte Kategorie und ein bestimmtes Land zurück.

BestSellers_TopBrands-Tabelle (alt) verwenden

SELECT
  rank,
  previous_rank,
  brand
FROM
  `DATASET.BestSellers_TopBrands_MERCHANT_ID`
WHERE
  _PARTITIONDATE = 'DATE' AND
  ranking_category = 267 /*Smartphones*/ AND
  ranking_country = 'US'
ORDER BY
  rank;

Tabelle BestSellersTopBrandsWeekly oder BestSellersTopBrandsMonthly verwenden (neu)

SELECT
  rank,
  previous_rank,
  brand
FROM
  `DATASET.BestSellersTopBrandsWeekly_MERCHANT_ID`
WHERE
  _PARTITIONDATE = 'DATE' AND
  report_category_id = 267 /*Smartphones*/ AND
  country_code = 'US'
ORDER BY
  rank;

Beispiel 4: Produkte der Top-Marken in Ihrem Inventar abrufen

Die folgenden Abfragen geben eine Liste der Produkte der Top-Marken in Ihrem Inventar zurück.

BestSellers_TopBrands-Tabelle (alt) verwenden

WITH latest_top_brands AS
  (
    SELECT
      *
    FROM
      `DATASET.BestSellers_TopBrands_MERCHANT_ID`
    WHERE
      _PARTITIONDATE = 'DATE'
  ),
  latest_products AS
  (
    SELECT
      product.*,
      product_category_id
    FROM
      `DATASET.Products_MERCHANT_ID` AS product,
      UNNEST(product.google_product_category_ids) AS product_category_id,
      UNNEST(destinations) AS destination,
      UNNEST(destination.approved_countries) AS approved_country
    WHERE
      _PARTITIONDATE = 'DATE'
  )
SELECT
  top_brands.brand,
  (SELECT name FROM top_brands.ranking_category_path
  WHERE locale = 'en-US') AS ranking_category,
  top_brands.ranking_country,
  top_brands.rank,
  products.product_id,
  products.title
FROM
  latest_top_brands AS top_brands
INNER JOIN
  latest_products AS products
ON top_brands.google_brand_id = products.google_brand_id AND
   top_brands.ranking_category = product_category_id AND
   top_brands.ranking_country = products.approved_country;

Tabelle BestSellersTopBrandsWeekly oder BestSellersTopBrandsMonthly verwenden (neu)

WITH latest_top_brands AS
  (
    SELECT
      *
    FROM
      `DATASET.BestSellersBrandMonthly_MERCHANT_ID`
    WHERE
      _PARTITIONDATE = 'DATE'
  ),
  latest_products AS
  (
    SELECT
      product.*,
      product_category_id
    FROM
      `DATASET.Products_MERCHANT_ID` AS product,
      UNNEST(product.google_product_category_ids) AS product_category_id,
      UNNEST(destinations) AS destination,
      UNNEST(destination.approved_countries) AS approved_country
    WHERE
      _PARTITIONDATE = 'DATE'
  )
SELECT
  top_brands.brand,
  - The full category name is not supported in the new BestSellersTopBrands tables.
  - (SELECT name FROM top_brands.ranking_category_path
  - WHERE locale = 'en-US') AS ranking_category,
  top_brands.category_id,
  top_brands.rank,
  products.product_id,
  products.title
FROM
  latest_top_brands AS top_brands
INNER JOIN
  latest_products AS products
ON top_brands.brand = products.brand AND
   top_brands.category_id = product_category_id AND
   top_brands.country_code = products.approved_country;

Ersetzen Sie in diesen Abfragen Folgendes:

  • DATASET: der Name Ihres Datasets
  • MERCHANT_ID: die Händlerkonto-ID
  • DATE: das Datum im Format YYYY-MM-DD

Nächste Schritte