Export your retail data from Vertex AI Search for commerce into
BigQuery. For more information, seeExport your data into
BigQuery.
Alternatively, if your product and user event data is already in
BigQuery, in the Vertex AI Search for commerce format, you can use
that data to get Looker dashboards. In this case you don't need to
upload your retail data and export it to BigQuery. For more
information about the BigQuery format,
seeProduct schemaandAbout user events.
Set up Looker
Get a Looker instance from your Looker Sales Engineer or
Professional Services consultant.
Set up a connection in Looker to BigQuery by
following the instructions inGoogle
BigQueryin the Looker
documentation. Your Looker Sales Engineer or Professional Services
consultant will assist you in this task if needed. Save the name of the
connection that you set up to use inInstall the Looker
Block.
Convert your user event BigQuery view to a table
Looker Dashboards require your user event data to be in a BiqQuery
table, not a view.
To convert your user event BigQuery view to a table, do the
following:
Replace the variables in the following SQL example code as follows:
rdm_user_event_view. The project, dataset, and table IDs of the user
event view that you exported to BigQuery. The format isproject_id.dataset_id.table_id.
rdm_user_event_table. The project, dataset, and table IDs in
BigQuery for the new BigQuery table. Use the
same project ID and dataset ID that you used for the user event view that
you exported to BigQuery. For the table ID, usetbl_events.
The format isproject_id.dataset_id.tbl_events.
If it's not already selected, select the project that contains your user
event table.
In theEditorpane, paste the SQL code sample.
Clickplay_circleRunand wait for
the query to finish running.
Your new table is written to the location in BigQuery that you
set using therdm_user_event_tablevariable. Save this location to use inInstall the Looker Block.
Create a materialized view for sales
Use the following SQL example code to create a materialized view that your
Looker dashboards can query. For more information, seeIntroduction to
materialized viewsin the
BigQuery documentation.
To create a materialized view for sales, do the following:
Replace the variables in the following SQL example code as follows:
mv_sales. The project, dataset, and table IDs in BigQuery
for the new materialized view for sales. Use the same project ID and dataset
ID that you used for the user event table that you exported to
BigQuery. For the table ID, usemv_sales. The format isproject_id.dataset_id.mv_sales.
rdm_user_event_table. The project, dataset, and table IDs of the user
event table that you exported to BigQuery. The format isproject_id.dataset_id.table_id.
CREATEMATERIALIZEDVIEW`MV_SALES`OPTIONS(friendly_name="Sales View",description="View of Sales Data",labels=[("team","cloud_retail_solutions"),("environment","development")])ASSELECTEXTRACT(DATEFROMevent_time)asday,session_idassession,ANY_VALUE(TRIM(UPPER(visitor_id)))asvisitor,ANY_VALUE(TRIM(UPPER(user_info.user_id)))asuser,ANY_VALUE(TRIM(UPPER(purchase_transaction.id)))astx_id,MAX(purchase_transaction.revenue)astx_total,MAX(purchase_transaction.tax)astx_tax,MAX(purchase_transaction.cost)astx_cost,MAX(purchase_transaction.currency_code)astx_cur,SUM(d.quantity*d.product.price_info.price)asproduct_total,COUNT(d)ASbasket_sizeFROM`RDM_USER_EVENT_TABLE`,UNNEST(product_details)dWHEREevent_type='purchase-complete'GROUPBYEXTRACT(DATEFROMevent_time),session_id;
Copy the SQL code sample from the previous step.
Open the BigQuery page in the Google Cloud console.
If it's not already selected, select the project that contains your user
event table.
In theEditorpane, paste the SQL code sample.
Clickplay_circleRunand wait for
the query to finish running.
Your new materialized view for sales is written to the location in
BigQuery that you set using themv_salesvariable. Save this
location to use inInstall the Looker
Block.
Install the Looker Block
In this procedure, you download a Looker Block using the
Looker Marketplace website that is connected to your Looker
instance. We also have a publicLooker
Marketplace, where you can view the various Looker
Blocks that are available, but you cannot download Looker Blocks from
that website.
Go to the Looker instance that your Looker Sales Engineer
helped you set up inSet up Looker.
If you agree to allow Looker to do the actions shown in the dialog,
clickAgree and Continue.
TheConfigurationdialog appears.
Set theConfigurationdialog:
In theEvents Tablebox, enter the project, dataset, and table IDs of
the user event table that you exported to BigQuery. The
format isproject_id.dataset_id.table_id.
In theProducts Tablebox, enter the project, dataset, and table IDs
of the retail product table that you exported to BigQuery.
The format isproject_id.dataset_id.table_id.
In theSales Materialized Viewbox, enter the project, dataset, and
table IDs of the materialized view for sales that you created inCreate a
materialized view for sales. The
format isproject_id.dataset_id.table_id.
In theConnectionbox, select the name of the connection that you
created inSet up Looker.
ClickInstallto complete the configuration and install the
Looker Block.
TheLooker Marketplacepage appears.
On theLooker Marketplacepage, in theDiscovery: E-Commerce
Insightsrow, clickOpen.
TheDiscovery: E-Commerce Insightspage appears.
Click a pane under theDashboardsheading to view a dashboard.
Customize the Looker Block
This Looker Block uses refinements for customization. For more
information about using refinements to customize Looker Blocks
installed from the Looker Marketplace, seeCustomizing Looker
Marketplace Blocks.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Get dashboards that show key performance indicators\n\nThis page explains the process for getting Looker dashboards that can\ndisplay key performance indicators for your retail business.\n\nBefore you begin\n----------------\n\nBefore you can get Looker dashboards for your retail business, you\nmust:\n\n- Have your retail data uploaded using Vertex AI Search for commerce. For more\n information, see:\n\n - [Import catalog information](/retail/docs/upload-catalog)\n - [Record real-time user events](/retail/docs/record-events)\n - [Import historical user events](/retail/docs/import-user-events)\n- Export your retail data from Vertex AI Search for commerce into\n BigQuery. For more information, see [Export your data into\n BigQuery](/retail/docs/export-data-into-bq).\n\n Alternatively, if your product and user event data is already in\n BigQuery, in the Vertex AI Search for commerce format, you can use\n that data to get Looker dashboards. In this case you don't need to\n upload your retail data and export it to BigQuery. For more\n information about the BigQuery format,\n see [Product schema](/retail/docs/catalog#schema) and [About user events](/retail/docs/user-events).\n\nSet up Looker\n-------------\n\n1. Get a Looker instance from your Looker Sales Engineer or\n Professional Services consultant.\n\n2. Set up a connection in Looker to BigQuery by\n following the instructions in [Google\n BigQuery](https://cloud.google.com/looker/docs/db-config-google-bigquery) in the Looker\n documentation. Your Looker Sales Engineer or Professional Services\n consultant will assist you in this task if needed. Save the name of the\n connection that you set up to use in [Install the Looker\n Block](#install-the-looker-block).\n\nConvert your user event BigQuery view to a table\n------------------------------------------------\n\nLooker Dashboards require your user event data to be in a BiqQuery\ntable, not a view.\n\nTo convert your user event BigQuery view to a table, do the\nfollowing:\n\n1. Replace the variables in the following SQL example code as follows:\n\n - **rdm_user_event_view** . The project, dataset, and table IDs of the user\n event view that you exported to BigQuery. The format is\n `project_id.dataset_id.table_id`.\n\n - **rdm_user_event_table** . The project, dataset, and table IDs in\n BigQuery for the new BigQuery table. Use the\n same project ID and dataset ID that you used for the user event view that\n you exported to BigQuery. For the table ID, use `tbl_events`.\n The format is `project_id.dataset_id.tbl_events`.\n\n ```mysql\n CREATE OR REPLACE TABLE `\u003cvar translate=\"no\"\u003eRDM_USER_EVENT_TABLE\u003c/var\u003e`\n AS SELECT * FROM `\u003cvar translate=\"no\"\u003eRDM_USER_EVENT_VIEW\u003c/var\u003e`\n ```\n2. Copy the SQL code sample from the previous step.\n\n3. Open the BigQuery page in the Google Cloud console.\n\n [Go to the BigQuery page](https://console.cloud.google.com/bigquery)\n4. If it's not already selected, select the project that contains your user\n event table.\n\n5. In the **Editor** pane, paste the SQL code sample.\n\n6. Click play_circle **Run** and wait for\n the query to finish running.\n\nYour new table is written to the location in BigQuery that you\nset using the **rdm_user_event_table** variable. Save this location to use in\n[Install the Looker Block](#install-the-looker-block).\n\nCreate a materialized view for sales\n------------------------------------\n\nUse the following SQL example code to create a materialized view that your\nLooker dashboards can query. For more information, see [Introduction to\nmaterialized views](https://cloud.google.com/bigquery/docs/materialized-views-intro) in the\nBigQuery documentation.\n\nTo create a materialized view for sales, do the following:\n\n1. Replace the variables in the following SQL example code as follows:\n\n - **mv_sales** . The project, dataset, and table IDs in BigQuery\n for the new materialized view for sales. Use the same project ID and dataset\n ID that you used for the user event table that you exported to\n BigQuery. For the table ID, use `mv_sales`. The format is\n `project_id.dataset_id.mv_sales`.\n\n - **rdm_user_event_table** . The project, dataset, and table IDs of the user\n event table that you exported to BigQuery. The format is\n `project_id.dataset_id.table_id`.\n\n ```mysql\n CREATE MATERIALIZED VIEW `\u003cvar translate=\"no\"\u003eMV_SALES\u003c/var\u003e`\n OPTIONS(\n friendly_name=\"Sales View\",\n description=\"View of Sales Data\",\n labels=[(\"team\", \"cloud_retail_solutions\"), (\"environment\", \"development\")]\n )\n AS\n SELECT\n EXTRACT(DATE FROM event_time) as day,\n session_id as session,\n ANY_VALUE(TRIM(UPPER(visitor_id))) as visitor,\n ANY_VALUE(TRIM(UPPER(user_info.user_id))) as user,\n ANY_VALUE(TRIM(UPPER(purchase_transaction.id))) as tx_id,\n MAX(purchase_transaction.revenue) as tx_total,\n MAX(purchase_transaction.tax) as tx_tax,\n MAX(purchase_transaction.cost) as tx_cost,\n MAX(purchase_transaction.currency_code) as tx_cur,\n SUM(d.quantity*d.product.price_info.price) as product_total,\n COUNT(d) AS basket_size\n FROM `\u003cvar translate=\"no\"\u003eRDM_USER_EVENT_TABLE\u003c/var\u003e`, UNNEST(product_details) d\n WHERE event_type = 'purchase-complete'\n GROUP BY EXTRACT(DATE FROM event_time), session_id;\n ```\n2. Copy the SQL code sample from the previous step.\n\n3. Open the BigQuery page in the Google Cloud console.\n\n [Go to the BigQuery page](https://console.cloud.google.com/bigquery)\n4. If it's not already selected, select the project that contains your user\n event table.\n\n5. In the **Editor** pane, paste the SQL code sample.\n\n6. Click play_circle **Run** and wait for\n the query to finish running.\n\nYour new materialized view for sales is written to the location in\nBigQuery that you set using the **mv_sales** variable. Save this\nlocation to use in [Install the Looker\nBlock](#install-the-looker-block).\n\nInstall the Looker Block\n------------------------\n\nIn this procedure, you download a Looker Block using the\nLooker Marketplace website that is connected to your Looker\ninstance. We also have a public [Looker\nMarketplace](https://marketplace.looker.com), where you can view the various Looker\nBlocks that are available, but you cannot download Looker Blocks from\nthat website.\n\n1. Go to the Looker instance that your Looker Sales Engineer\n helped you set up in [Set up Looker](#set-up-looker).\n\n2. Click storefront, and then click\n **Discover**.\n\n The Looker Marketplace page appears.\n3. In the search box, enter `discovery`.\n\n The **Models** pane appears, displaying **Discovery: E-Commerce Insights**.\n4. Click **Discovery: E-Commerce Insights**.\n\n5. Click **Install \\\u003e Install**.\n\n6. If you accept the license agreement, click **Accept**.\n\n7. If you agree to allow Looker to do the actions shown in the dialog,\n click **Agree and Continue**.\n\n The **Configuration** dialog appears.\n8. Set the **Configuration** dialog:\n\n 1. In the **Events Table** box, enter the project, dataset, and table IDs of\n the user event table that you exported to BigQuery. The\n format is `project_id.dataset_id.table_id.`\n\n 2. In the **Products Table** box, enter the project, dataset, and table IDs\n of the retail product table that you exported to BigQuery.\n The format is `project_id.dataset_id.table_id.`\n\n 3. In the **Sales Materialized View** box, enter the project, dataset, and\n table IDs of the materialized view for sales that you created in [Create a\n materialized view for sales](#create-a-materialized-view-for-sales). The\n format is `project_id.dataset_id.table_id.`\n\n 4. In the **Connection** box, select the name of the connection that you\n created in [Set up Looker](#set-up-looker).\n\n 5. Click **Install** to complete the configuration and install the\n Looker Block.\n\n The **Looker Marketplace** page appears.\n9. On the **Looker Marketplace** page, in the **Discovery: E-Commerce\n Insights** row, click **Open**.\n\n The **Discovery: E-Commerce Insights** page appears.\n10. Click a pane under the **Dashboards** heading to view a dashboard.\n\nCustomize the Looker Block\n--------------------------\n\nThis Looker Block uses refinements for customization. For more\ninformation about using refinements to customize Looker Blocks\ninstalled from the Looker Marketplace, see [Customizing Looker\nMarketplace Blocks](https://cloud.google.com/looker/docs/marketplace-customize-blocks)."]]