Google For Retail
i found this tool on the internet it’s a new project called Google Retail
The goal of this task it’s trying to import a catalog of clothes stores into Big Query and then upload it into the Google Retail platform into Google Cloud.
- Enable
- Setup authentication for your application
- make a query from your catalog database
- import into Big Query
- import into Google Retail
if you don't have an existing Google Cloud project you can click on the link below Set up a Google Cloud project then you need to create an API KEY and Enable the Retail API
This is the link to enable the Google Retail API
- Click the ENABLE button in the Google Cloud console to enable the API.
Set up authentication for your application
You must set up both of the following authentication methods to access the Retail API:
- Service Account — Applications use a service account to authenticate calls to
Product
. - API Key — Applications use an API key for calls to user event logging APIs.
Create a service account
- Go to the Cloud Console Credentials page.
- Select the project that you are creating credentials for (the project may already be selected).
- Click Create credentials and then select Service account key.
- Fill in the following fields:
5. Click Create to create the service account.
6. The JSON file that contains the public/private key for the new service account is automatically downloaded to your computer. This JSON file is the only copy of the key for your service account. Be sure to store it in a secure location. The JSON key file must be stored in a location that is accessible from your application (see your-service-account-json-key-file in Authenticating using a service account (OAuth 2.0).
Data importing into Big Query
there are different way to import the data in Google Retail
- Importing catalog data from Merchant Center
- Importing catalog data from BigQuery
- Importing catalog data from Cloud Storage
in this example, we are going to import the data thru BigQuery
the first step create a table called catalog and import this schema below
to import the schema below click on ```edit as text ```
after that, i create i simple python script that makes a query into MySQL and get all information about the catalog in this example I will get just the info below
This is my Python Script
i run my script and now i have my catalog into bigquery
now you can go to Retail Dashboard and import the data from BigQuery and schedule an automatic job
you go first on import product catalog
then you go to source data and select BigQuery
select your Branch in this case Branch1
then select Retail Product Catalogs Schema and your Big Query Table
after the import is done you can find your data in data dashboard
now you can set up your automatic cron on cloud shell
if you have any question please let me know i would love to help you
below all links that i used during this task