# Google Business Profile Import Integration You can import customer information using the Google Business Profile(formerly Google My Business) import integration. With this connector, you can consolidate statistics, including ratings and reviews, of all your locations. ## Prerequisites - Google Business Profile account ([www.google.com/business](https://www.google.com/business/)). - Complete prerequisite list from [Google Business Profile Prerequisites](https://developers.google.com/my-business/content/prereqs). - Basic knowledge of Treasure Data, including[Treasure Data Toolbelt](https://toolbelt.treasuredata.com/). ## Use the TD Console to Create Your Connection ### Obtain your Credentials 1. Get OAuth 2.0 Client credentials from the [developer console](https://console.developers.google.com/) for your API project. 2. Create **Refresh token** for OAuth 2.0 Client. You can use your own OAuth 2.0-compliant way or follow the guide: [Google's OAuth playground](https://developers.google.com/google-ads/api/docs/oauth/playground). Ensure you use **OAuth2 client ID** and **OAuth2 client secret** from the API project you created. API Scope is - https://www.googleapis.com/auth/business.manage ### Enable API You need to enable the following three APIs 1. My Business Business Information API. ![](/assets/my-business-business-information-api.9103d2004085b22b7d1cc54547183b36862e10b24b232c939fe264e6cbdd86df.243f5fa1.png) 2. My Business Account Management API. ![](/assets/my-business-acount-management.f00aa3077c493ce14679100b6a0846da7b12b532d9abc06b3532815c5b83cb18.243f5fa1.png) 3. Business Profile Performance API.![](/assets/screen-shot-2023-02-07-at-11.51.10.ef174deb53208b30839ab28af02864293fc5b24e428fe1bd433cf736d363b39e.243f5fa1.png) ### Create a New Connection When you configure a data connection, you provide authentication to access the integration. In Treasure Data, you configure the authentication and then specify the source information. 1. Open TD Console. 2. Navigate to **Integrations Hub** >  **Catalog.** 3. Search for and select Google Business Profile. ![](/assets/google-business-profile-catalog.a5e5728b911405bd272e5a8df693999dbac8c7712e0dc3d6a57b1b2db1cb5ce4.243f5fa1.png) 4. The following dialog opens. ![](/assets/authentication.d9cbb85f1d19f28db40809539cf4f6fb8fe93aaf7d6092d96d41b4a2f35198bb.243f5fa1.png) 5. Enter the required credentials which you obtained in the **Obtain your credentials** section. 6. Enter a name for your connection and select **Done.** ## Transfer Your Google Business Profile Account Data to Treasure Data After creating the authenticated connection, you are automatically taken to the Authentications tab. Look for the connection you created and select **New Source**. **Connection** 1. Type a name for your **Source**in the Data Transfer field**.** 2. Select **Next**. ![](/assets/create-source-1.e2c2a92b12a438e589b91ac21491c917af51a1c3105ee73f99fd0488e14d424f.243f5fa1.png) **Source Table** 1. Edit the following parameters according to your needs:![](/assets/screen-shot-2023-02-07-at-12.00.57.f96451df90345f5a782452940b2805dd5619db4a5d53333f1a47607c081e9632.243f5fa1.png) | **Parameters** | **Description** | | --- | --- | | **Data Type** | - **Accounts** - fetch accounts data - **Locations** - fetch all locations data for all accounts - **Location Reviews** - fetch all reviews data for all locations - **Location Daily Metrics Time Series** - fetch daily metrics time series for all locations - **Location Monthly Search Keywords Impressions -**fetch monthly search keywords impressions for all location | | **Daily Metric** | Required only for **Location Daily Metrics Time Series**. - **BUSINESS_IMPRESSIONS_DESKTOP_MAPS -** Business impressions on Google Maps on Desktop devices. Multiple impressions by a unique user within a single day are counted as a single impression. - **BUSINESS_IMPRESSIONS_DESKTOP_SEARCH -** Business impressions on Google Search on Desktop devices. Multiple impressions by a unique user within a single day are counted as a single impression. - **BUSINESS_IMPRESSIONS_MOBILE_MAPS -** Business impressions on Google Maps on Mobile devices. Multiple impressions by a unique user within a single day are counted as a single impression. - **BUSINESS_IMPRESSIONS_MOBILE_SEARCH -** Business impressions on Google Search on Mobile devices. Multiple impressions by a unique user within a single day are counted as a single impression. - **BUSINESS_CONVERSATIONS -** The number of message conversations received on the business profile. - **BUSINESS_DIRECTION_REQUESTS -** The number of times a direction request was requested to the business location. - **CALL_CLICKS -** The number of times the business profile call button was clicked. - **WEBSITE_CLICKS -** The number of times the business profile website was clicked. - **BUSINESS_BOOKINGS -** The number of bookings received from the business profile. - **BUSINESS_FOOD_ORDERS -** The number of food orders received from the business profile. | | **Start Time** | Optional for **Location Daily Metrics Time Series**and **Location Monthly Search Keywords Impressions** data type. - **Location Daily Metrics Time Series:**Format as YYYY-MM-DD, e.g.: 2022-10-10 - **Location Monthly Search Keywords Impressions:**Format as YYYY-MM, e.g.: 2022-10 If empty **Start Time** will be calculated as current time of actual request to API minus 18 month. Field doesn’t allow time in more than 18 month in past. | | **End Time** | Optional for **Location Daily Metrics Time Series**and **Location Monthly Search Keywords Impressions** data type. - **Location Daily Metrics Time Series:**Format as YYYY-MM-DD, e.g.: 2022-10-10 - **Location Monthly Search Keywords Impressions:**Format as YYYY-MM, e.g.: 2022-10 If empty **End Time** will be calculated as current time of actual request to API. Field doesn’t allow time in future. | | **Incremental Loading** | Optional for **Location Daily Metrics Time Series**and **Location Monthly Search Keywords Impressions** data type. It enables incremental report loading with new **Start Time** and **End Time** automatic calculation. Example: if you start incremental loading with **Start Time** = `2014-10-02` and **End Time** = `2014-10-03`, on the next job run new **Start Time** will be `2014-10-04` and **End Time** = `2014-10-05` | ### **Data Settings** 1. Select **Next**. The Data Settings page opens. 2. Optionally, edit the data settings or skip this page of the dialog. ![](/assets/create-source-3.7e7a74414eea917265926a152f131ac4341dd8fbeece7256a1fd0ff2e79e6882.243f5fa1.png) ### Data Preview You can see a [preview](/products/customer-data-platform/integration-hub/batch/import/previewing-your-source-data) of your data before running the import by selecting Generate Preview. Data preview is optional and you can safely skip to the next page of the dialog if you choose to. 1. Select **Next**. The Data Preview page opens. 2. If you want to preview your data, select **Generate Preview**. 3. Verify the data. ### Data Placement For data placement, select the target database and table where you want your data placed and indicate how often the import should run. 1. Select **Next.** Under Storage, you will create a new or select an existing database and create a new or select an existing table for where you want to place the imported data. 2. Select a **Database** > **Select an existing** or **Create New Database**. 3. Optionally, type a database name. 4. Select a **Table**> **Select an existing** or **Create New Table**. 5. Optionally, type a table name. 6. Choose the method for importing the data. - **Append** (default)-Data import results are appended to the table. If the table does not exist, it will be created. - **Always Replace**-Replaces the entire content of an existing table with the result output of the query. If the table does not exist, a new table is created. - **Replace on New Data**-Only replace the entire content of an existing table with the result output when there is new data. 7. Select the **Timestamp-based Partition Key** column. If you want to set a different partition key seed than the default key, you can specify the long or timestamp column as the partitioning time. As a default time column, it uses upload_time with the add_time filter. 8. Select the **Timezone** for your data storage. 9. Under **Schedule**, you can choose when and how often you want to run this query. #### Run once 1. Select **Off**. 2. Select **Scheduling Timezone**. 3. Select **Create & Run Now**. #### Repeat Regularly 1. Select **On**. 2. Select the **Schedule**. The UI provides these four options: *@hourly*, *@daily* and *@monthly* or custom *cron*. 3. You can also select **Delay Transfer** and add a delay of execution time. 4. Select **Scheduling Timezone**. 5. Select **Create & Run Now**. After your transfer has run, you can see the results of your transfer in **Data Workbench** > **Databases.**