# Google My Business

### Snapshot

| Features                        | Details                                                    |
| ------------------------------- | ---------------------------------------------------------- |
| Release Status                  | Released                                                   |
| Source API Version              | v4                                                         |
| Table Selection                 | Yes                                                        |
| Column Selection                | Yes                                                        |
| Edit Integration                | Yes                                                        |
| Replication Type Selection      | No                                                         |
| Authentication Parameters       | <p>GoogleMyBusiness Email<br>GoogleMyBusiness password</p> |
| Replication Type                | <p>Key based Replication<br>Full Replication</p>           |
| Replication Key                 | <p>DATE<br>NA</p>                                          |
| Suggested Replication Frequency | 24 hrs                                                     |

| Tables/APIs Supported |                    |
| --------------------- | ------------------ |
| Accounts              | Locations          |
| LocationReviews       | MediaCustomerLists |
| Questions             | ReportInsights     |

### Integrate Google My Business with Daton

1. Sign in to Daton
2. Select Google My Business from Integrations page
3. Provide Integration Name Replication Frequency and History. Integration name would be used in creating tables for the integration and cannot be changed later
4. Provide your Email and Password associated with Google My Business.
5. After providing the Email,password to authorize Daton to periodically extract data from Google My Business.
6. Post successful authentication in the second step, is designed in such a way that it contains static tables(Accounts,Locations,Location reviews,Questions) which you will be prompted to configure, and it also contains the custom tables(reportInsights) and metrics , metric options which you will be prompted to configure.
7. Then select all required fields for each table (You will not have an option to configure fields for custom tables(Report Insights))
8. Submit the integration.

### Workflow

1. Integrations would be in Pending state initially and will be moved to Active state as soon as the first job loads data successfully on to the configured warehouse
2. Users would be able to edit/pause/re-activate/delete integration anytime
3. Users can view job status and process logs from the integration details page by clicking on the integration name from the active list

### GoogleMyBusiness Data

**Accounts**

Purpose: Lists all the accounts for the authenticated user. This includes all accounts that the user owns, as well as any accounts for which the user has management rights.

Source API Documentation  <https://developers.google.com/my-business/reference/accountmanagement/rest/v1/accounts/list>

Replication: Full Replication

Replication Key: NA

**Fields**

| Name              | Target Datatype |
| ----------------- | --------------- |
| name              | STRING          |
| accountName       | STRING          |
| type              | STRING          |
| verificationState | STRING          |
| vettedState       | STRING          |
| accountNumber     | NUMERIC         |
| permissionLevel   | STRING          |
| role              | STRING          |

**Locations**

Purpose: Lists the locations for the specified account.

Source API Documentation  <https://developers.google.com/my-business/reference/rest/v4/accounts.locations/list>

Replication: Full Replication

Replication Key: NA

**Fields**

| Name            | Target Datatype |
| --------------- | --------------- |
| name            | STRING          |
| storeCode       | STRING          |
| locationName    | STRING          |
| primaryPhone    | STRING          |
| primaryCategory | RECORD          |
| websiteUrl      | STRING          |
| regularHours    | RECORD          |
| locationKey     | RECORD          |
| latlng          | RECORD          |
| openInfo        | RECORD          |
| locationState   | RECORD          |
| metaData        | RECORD          |
| languageCode    | STRING          |
| address         | RECORD          |

**LocationReviews**

Purpose:Returns the paginated list of reviews for the specified location. This operation is only valid if the specified location is verified.

Source API Documentation  <https://developers.google.com/my-business/reference/rest/v4/accounts.locations.reviews/list>

Replication: Full Replication

Replication Key: NA

**Fields**

| Name       | Target Datatype |
| ---------- | --------------- |
| reviewId   | STRING          |
| reviewer   | RECORD          |
| starRating | STRING          |
| comment    | STRING          |
| createTime | TIMESTAMP       |
| updateTime | TIMESTAMP       |
| name       | STRING          |

**MediaCustomerLists**

Purpose: Returns a list of media items associated with a location that have been contributed by customers.

Source API Documentation  <https://developers.google.com/my-business/reference/rest/v4/accounts.locations.media.customers/list>

Replication: Key-Based Replication

Replication Key: lastRunDate

**Fields**

| Name         | Target Datatype |
| ------------ | --------------- |
| name         | STRING          |
| mediaFormat  | STRING          |
| googleUrl    | STRING          |
| thumbnailUrl | STRING          |
| createTime   | TIMESTAMP       |
| dimensions   | RECORD          |
| insights     | RECORD          |
| attribution  | RECORD          |

**Questions**

Purpose:Returns the paginated list of questions and some of its answers for a specified location.

Source API Documentation  <https://developers.google.com/my-business/reference/rest/v4/accounts.locations.questions/list>

Replication: Key-Based Replication

Replication Key: lastRunDate

**Fields**

| Name              | Target Datatype |
| ----------------- | --------------- |
| accountId         | STRING          |
| locationId        | STRING          |
| name              | STRING          |
| author            | RECORD          |
| text              | STRING          |
| createTime        | TIMESTAMP       |
| updateTime        | TIMESTAMP       |
| topAnswers        | RECORD          |
| totalAnswersCount | NUMERIC         |

**ReportInsights**

Purpose: Returns a report containing insights on one or more metrics by location.

Source API Documentation  <https://developers.google.com/my-business/reference/rest/v4/accounts.locations/reportInsights>

Replication: Key-Based Replication

Replication Key: lastRunDate

**Fields**

| Name         | Target Datatype |
| ------------ | --------------- |
| locationName | STRING          |
| metricValues | RECORD          |
| timezone     | STRING          |
