---
schema_version: "1"
id: f9d66fd6cc83b8c9aca06256f41efa4af74b1403470119b0c5f376825c654188
title: Prepare Your Google Drive Unstructured Data Connection
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-int/guides/googledrive/c360-a-prepare-googledrive-unstructured-connection.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-prepare-googledrive-unstructured-connection.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4365adb7c05d41f6cfd15df12ff2a141b6e52b8cd8305178a9db6e70c5da241b
products:
  - Data 360 Integration Guide
  - Data 360 Developer Documentation
---
# Prepare Your Google Drive Unstructured Data Connection

Before you connect Google Drive to Data 360, gather the required information and complete the preliminary setup in Google Console and Google Drive.

## Authorize Access to Google Drive and Service Account Setup

- In the Google Cloud Console, turn on the [Google Drive API](https://developers.google.com/workspace/guides/enable-apis).
- In the Google Cloud Console, turn on the [Google Drive Labels API](https://console.cloud.google.com/apis/library/drivelabels.googleapis.com). The connector reads Drive labels through this API and ingests them alongside your files.
- **Service accounts** are Google identities used by applications to securely access Google APIs. For this connector, **authentication is service account-based**. With a service account, the connector can read files from Google Drive and access user information in your Google Workspace domain.

   >Note: You must use an admin account to complete these steps.


## Step 1 - Create a Google Service Account

1. Go to [https://console.cloud.google.com/.](https://console.cloud.google.com/)
2. Navigate to **IAM & Admin Select.**
3. Click on **Create service account**.
4. Enter a **Service account name** and click on **Create and continue**. This will create a service account in Google.

## Step 2 - Configure Service Account Details

1. To delegate permissions to the service account, go to **Permissions**.
2. Select **Manage access**.
3. Assign the **Service Account Token Creator** role.
4. Save your changes.

## Step 3 - Generate a Service Account Private Key

1. To create a key for the service account, go to **Keys**.
2. Select **Add Key**.
3. Click **Create new key**.
4. Select **JSON** for the key type and click **Create**.

This will save a JSON file that contains `client_email`, `scope`, `private_key`, and `token_url`. You use these values to authorize users with the Google Drive connector.

Below is how the private key JSON file will look like:

```json
{
  "type": "service_account",
  "project_id": "stone-history-462608-v5",
  "private_key_id": "ee40528134979037951d877e6b682723fc072c7a",
  "private_key": "-----BEGIN PRIVATE KEY-----\<private key>\n\-----END PRIVATE KEY-----\n",
  "client_email": "sentos-poc@stone-history-462608-v5.iam.gserviceaccount.com",
  "client_id": "114668950453962180189",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/sentos-poc%40stone-history-462608-v5.iam.gserviceaccount.com",
  "universe_domain": "googleapis.com"
}
```

   >**Note**: You can now use your service account for Agentforce use cases. To use this account to access data for multiple users, you must configure domain-wide delegation for the service account. If you want to ingest all shared or personal drives, configure domain-wide delegation. If you're ingesting a specific shared drive ID, you can skip these steps.

Your service account is ready.

## Step 4 - Grant Drive Labels Access to the Service Account

Grant the service account access to Drive labels in the Google Admin Console. Complete these steps with a Google Workspace admin account.

1. Sign in to the [Google Admin Console](https://admin.google.com/) and go to **Rules & Settings** > **Labels**.
2. Grant the service account permission to manage label access so it can read the labels catalogue.
3. For each label you want to ingest, open **Edit label** > **Permissions** and add the service account email address (`client_email` from the private key JSON).

   >**Note**: Only labels explicitly shared with the service account are ingested. Labels not shared with the service account are omitted from ingestion, even if they are applied to files the connector can read. Labels can be applied only at the file level; folder-level labels are not supported.

## Gather Info in Google Drive

- Ensure that you complete these steps using a Google account with access to the files and folders that you want to connect to Salesforce.
- To ingest unstructured data, find the shared drive or folder in Google Drive that contains the relevant files. Identify the drive ID at the end of the folder's URL, such as https://drive.google.com/drive/folders/{drive_id}.
- If you're ingesting a specific shared drive ID, verify that the admin account email used to create the connection has access to that drive.

## Next Step

- [Set Up a Google Drive Unstructured Connection](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-set-up-googledrive-unstructured-connection.md)
