# BigQuery Datasource

## Purpose of this integration

The BigQuery Datasource integration isn't technically an integration — it's a utility that will be used by other integrations. It establishes credentials that will be used to access a BigQuery project that contains data you want to extract into Daasity.

Once you have a BigQuery Datasource set up, you will use it as the connection source for one or more BigQuery Table Replicators, where the actual data extraction happens."

Once you've set up a BigQuery Datasource, it will appear in the Datasource dropdown when creating a BigQuery Table Replicator:

<figure><img src="https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/6PgqAFj4kXcxunjgC94I/image.png" alt=""><figcaption></figcaption></figure>

## Setup Instructions

<details>

<summary>Step 1: Create a service account for Daasity</summary>

In order for Daasity to be able to extract your GA4 BigQuery data, we need you to create a service account that we can use to give us read access.

If you haven't already created a service account for Daasity, you can start by navigating to <https://console.cloud.google.com/iam-admin/serviceaccounts/create>

In the details section, use whatever name, ID, and description details you prefer:

![](https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/ep4cC0TU5ZLWL2Pydsim/image.png)

***

Grant the service account **BigQuery User** and **BigQuery Data Viewer** roles:

![](https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/FApq9GC9wO8IdlbNrQ0H/image.png)

***

Granting users access to the service account is entirely optional. This will just dictate what other Google Cloud Platform users can see this service account:

![](https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/B21MQBQZLQVMFwB71pwl/image.png)

Finally, click **DONE**.

</details>

<details>

<summary>Step 2: Generate a service account key for the Daasity service account</summary>

The service account key will act as a password that will allow the Daasity service account access to your BigQuery data.

To generate it, first navigate to <https://console.cloud.google.com/iam-admin/serviceaccounts>

Then, click on the email of the service account you created in the previous step:

![](https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/LUclB0h4qC65DF2uaadi/image.png)

***

On the next page, navigate to the **KEYS** tab:

![](https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/JtHqdpiamGElcjBRLEKn/image.png)

***

Click **ADD KEY** and choose **Create new key**:

![](https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/wFRodJz8jb6wTiFupcRB/image.png)

***

In the pop-up, choose **JSON** and click **CREATE**:

![](https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/IHHPBwCfkF50ptTmpRsp/image.png)

This should generate a .json file that will be downloaded to your computer. You will use this file in the next step.

</details>

<details>

<summary>Step 3: Add the service account key to the BigQuery Datasource</summary>

In this step, you're going to add the service account and key information you generated in the previous step in the **General** section of the integration settings:

![](https://content.gitbook.com/content/amTMWiPne1v1V3L7mbuj/blobs/ohrVDxmYk6mJMWdHCGgn/image.png)

**Name:** Enter the name that you will want to see in the UI and Datasource dropdowns elsewhere

**Email**: The service account email

**JSON Service Key**: Enter the info from the JSON key you generated in the previous step.

You have 2 choices of how to do this:

A. Drag the file you downloaded in Step 4 onto the screen where it says **Drag file here**, or

B. Open the file you downloaded in Step 4, copy the contents, click the **Enter Key** tab, and paste the contents

Once you have filled out all of this info, click **CREATE** in the upper right corner. You will now be able to select this datasource when creating new BigQuery Table Replicators.

</details>
