# Integrating with BigQuery

[Prerequisites](#prerequisites)

[BigQuery Setup](#bigquery-setup)\
&#x20;   [Add an external user in BigQuery](#add-an-external-user-in-bigquery)

## Prerequisites

To connect BigQuery to Drivetrain, you need:

* An active BigQuery account
* Sharing privileges on BigQuery
* Admin privileges in Drivetrain

## BigQuery Setup <a href="#bigquery-setup" id="bigquery-setup"></a>

Drivetrain supports integration with BigQuery from a read-only external user account. To get started you would need to share the read-only access with <drivetrain@integrations-417606.iam.gserviceaccount.com> service account.

### Add an external user in BigQuery <a href="#add-an-external-user-in-bigquery" id="add-an-external-user-in-bigquery"></a>

To grant an access to external user, (someone who is not listed as an employee in the company), follow these steps:

1. Select the **Dataset/ Resource** which is to be shared with the user.
2. From the **Sharing** option on the right top of the page, route to **Permissions**.
3. Add <drivetrain@integrations-417606.iam.gserviceaccount.com> as principal.
4. Assign role - Set as **BigQuery Data Viewer**.
5. Select the above role & click **Save**

<div align="left"><figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Ffxs21edjoUjdTPUdVwAB%2Fimage%20(13).png?alt=media&#x26;token=018c2112-596f-4d15-a0bb-93fc7a95ae93" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
That’s it! Share the below details with your Customer Success Manager or Data Integrations Manager so that they can get started:

1. If you have given access to complete dataset, please share Project ID/Name and Dataset Name.
2. If you have given access to specific tables in the dataset, please Project ID/Name, Dataset Name and Table Names.
   {% endhint %}
