Migrar el informe "Superventas"
Este documento le ayudará a migrar de la versión antigua de los informes "Superventas" a la versión más reciente. La versión antigua del informe que exporta las tablas BestSellers_TopBrands_
, BestSellers_TopProducts_
y BestSellers_TopProducts_Inventory_
dejará de estar disponible el 1 de septiembre del 2025.
El nuevo informe "Superventas" ofrece lo siguiente:
Paridad con la versión anterior del informe y mayor coherencia con otros productos similares de Google, como los campos BestSellersBrandView y BestSellerProductClusterView de Content API for Shopping.
Estadísticas adicionales sobre los productos populares en Estadísticas de Google Merchant Center
Función de relleno ampliada (2 años en lugar de 14 días).
Tablas exportadas por informes antiguos y nuevos
En la siguiente tabla se comparan las tablas exportadas por los informes antiguos y los nuevos:
Informe antiguo | Nuevo informe |
---|---|
BestSellers_TopBrands |
BestSellersBrandWeekly y BestSellersBrandMonthly |
BestSellers_TopProducts |
BestSellersProductClusterWeekly y BestSellersProductClusterMonthly |
BestSellers_TopProducts_Inventory |
BestSellersEntityProductMapping |
El antiguo informe contiene una única agregación de datos de superventas durante un periodo de tiempo no especificado. El nuevo informe proporciona las agregaciones semanales y mensuales más recientes de estos datos en el momento de la solicitud.
Comparar BestSellers_TopBrands
con BestSellersBrandWeekly
y BestSellersBrandMonthly
La siguiente tabla le ayudará a identificar los campos de la tabla BestSellers_TopBrands
que tienen sustituciones equivalentes en las tablas BestSellersBrandWeekly
y BestSellersBrandMonthly
. No hay sustituciones disponibles para algunos campos de la tabla antigua.
BestSellers_TopBrands (antiguo) |
BestSellersBrandWeekly y BestSellersBrandMonthly (novedad) |
---|---|
rank_timestamp |
_PARTITIONDATE y _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 |
Comparar BestSellers_TopProducts
con BestSellersProductClusterWeekly
y BestSellersProductClusterMonthly
La siguiente tabla le ayudará a identificar los campos de la tabla BestSellers_TopProducts
que tienen sustituciones equivalentes en las tablas BestSellersProductClusterWeekly
y BestSellersProductClusterMonthly
. No hay sustituciones disponibles para algunos campos de la tabla antigua.
BestSellers_TopProducts (antiguo) |
BestSellersProductClusterWeekly y BestSellersProductClusterMonthly (novedad) |
---|---|
rank_timestamp |
_PARTITIONDATE y _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 (un solo título en lugar de una matriz para cada configuración regional) |
gtins |
variant_gtins |
google_brand_id |
|
brand |
brand |
google_product_category |
|
category_l1 , category_l2 , category_l3 , category_l4 y 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 |
Asignación de inventario de datos de superventas
En el antiguo informe "Superventas", los datos de superventas se asignan a los datos de inventario del comerciante en una nueva tabla generada, usando la columna rank_id
de la tabla TopProducts
.
En el nuevo informe "Superventas", la columna entity_id
se exporta en las tablas BestSellersProductCluster
, que se asignan a todos los IDs de producto del inventario del comerciante en la tabla BestSellersEntityProductMapping
.
BestSellers_TopProductsInventory (antiguo) |
BestSellersEntityProductMapping (nuevo) |
---|---|
rank_id (encontrado en BestSellers_TopProducts ) |
entity_id (encontrado en las tablas BestSellersProductClustersWeekly y BestSellersProductClustersMonthly ) |
product_id |
product_id |
merchant_id |
|
aggregator_id |
Consultas de ejemplo
En esta sección se destacan los cambios en las consultas de ejemplo que se usan para obtener datos de los productos más vendidos.
Ejemplo 1: Obtener los productos más vendidos de una categoría y un país concretos
Las siguientes consultas devuelven los productos más vendidos de una categoría y un país concretos.
Usar la tabla BestSellers_TopProducts
(antigua)
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;
Usar la tabla BestSellersProductClusterWeekly
o BestSellersProductClusterMonthly
(nueva)
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;
Ejemplo 2: Obtener los productos más vendidos de su inventario
Las siguientes consultas devuelven una lista de los productos más vendidos de su inventario.
Usar la tabla BestSellers_TopProducts
(antigua)
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);
Usar la tabla BestSellersProductClusterWeekly
o BestSellersProductClusterMonthly
(nueva)
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);
Además, si quiere saber el número de productos o marcas más vendidos de su inventario, haga una consulta en las tablas BestSellerProductClusterWeekly
o BestSellerProductClusterMonthly
con las columnas product_inventory_status
o brand_inventory_status
.
Consulta el siguiente ejemplo de consulta:
SELECT
*
FROM
`DATASET.BestSellersProductClusterMonthly_MERCHANT_ID`
WHERE
_PARTITIONDATE = 'DATE' AND
product_inventory_status != 'NOT_IN_INVENTORY'
ORDER BY
rank;
Ejemplo 3: Obtener las marcas más populares de una categoría y un país determinados
Las siguientes consultas devuelven una lista de las marcas más populares de una categoría y un país concretos.
Usar la tabla BestSellers_TopBrands
(antigua)
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;
Usar la tabla BestSellersTopBrandsWeekly
o BestSellersTopBrandsMonthly
(nueva)
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;
Ejemplo 4: Obtener productos de las marcas más vendidas de su inventario
Las siguientes consultas devuelven una lista de productos de las marcas más populares de su inventario.
Usar la tabla BestSellers_TopBrands
(antigua)
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;
Usar la tabla BestSellersTopBrandsWeekly
o BestSellersTopBrandsMonthly
(nueva)
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;
En estas consultas, sustituye lo siguiente:
DATASET
: el nombre del conjunto de datosMERCHANT_ID
: el ID de la cuenta de comercianteDATE
: la fecha en formatoYYYY-MM-DD
Siguientes pasos
- Para obtener más información sobre el nuevo informe "Superventas", consulte la tabla "Superventas" de Google Merchant Center.