Google BigQuery is an enterprise data warehouse for large-scale data analytics. You can connect Gtmhub to any table in a BigQuery dataset and create a Gtmhub entity based on it.

Prerequisites

Gtmhub supports two ways of integrating with Google BigQuery – using a Gtmhub-provided service account or using a service account owned by the user.

Using the Gtmhub-provided service account.

Gtmhub uses a service account with OAuth 2.0 authentication/authorization flow. Before you establish a connection to your BigQuery data set you need to make sure that the Gtmhub Service Account for Google API has been added to your project and assigned the necessary permissions. We recommend that you use a custom role and assign this role to the service account.

Creating a custom role in Google Cloud Platform

To create a custom role log in to your Google Cloud Platform account and navigate to the Console. Select the project where you want to create the custom role, then from the menu choose IAM & Admin > Roles. 

1. Click the Create Role button

2. Fill in details for the role you will be creating.

3. Add the following permissions:

big query.datasets.get
bigquery.jobs.create
bigquery.tables.get
bigquery.tables.getData
bigquery.tables.list

bigquery.readsessions.create

Graphical user interface, application

Description automatically generated

4. Click the Create button.

Adding Gtmhub Service Account to Cloud Platform project

In the IAM & Admin management console go to the IAM section. Click on the Add button to add the Gtmhub Service account, then use [email protected] as the user email. Finally set the custom role created earlier.

Graphical user interface, application

Description automatically generated

Using a user-owned service account

In the case of a user-provided Google service account, you need to download the key in form of a JSON file from the Google Cloud Developer website. To do it, you have to go to the Google Cloud Platform > Service Accounts > select your service account.

Graphical user interface, text, application, Teams

Description automatically generated

Then go to Keys > Add key > Create new Key.

Graphical user interface, text, application

Description automatically generated

Select JSON and click Create. This will download the JSON file to your PC.

How to connect

  • Gtmhub-provided service account

  1. In Gtmhub, navigate to Setup > Data Sources screen

  2. Click the Add new data source button

  3. From the Choose a connector dialog, select Google BigQuery from the Databases tab

Graphical user interface, application

Description automatically generated

Enter the necessary information to connect to your BigQuery dataset.

  • Project ID - this is the ID of the project where your dataset lives.

  • Dataset ID - this is the ID of the dataset you wish to connect to.

  • Google JSON – leave it blank.

Graphical user interface, application

Description automatically generated

Click on the Connect button. If Gtmhub has been granted the necessary permissions to read data from BigQuery you will be able to choose the table you want to pull data from. In this example, we will use a table named employees.

Graphical user interface, application

Description automatically generated

Select the table you want. Then choose its sync schedule.

  • User-owned service account

  1. In Gtmhub, navigate to Setup > Data Sources screen

  2. Click the Add new data source button

  3. From the Choose a connector dialog, select Google BigQuery from the Databases tab

Graphical user interface, application

Description automatically generated

Enter the necessary information to connect to your BigQuery dataset.

  • Project ID - this is the ID of the project where your dataset lives.

  • Dataset ID - this is the ID of the dataset you wish to connect to.

  • Google JSON – copy and paste the contents of the downloaded JSON file.

Graphical user interface, text, application

Description automatically generated

Click on the Connect button. If Gtmhub has been granted the necessary permissions to read data from BigQuery you will be able to choose the table you want to pull data from. In this example, we will use a table named employees.

Graphical user interface, application

Description automatically generated
Did this answer your question?