# Manually connect Google Analytics to the Developer Data framework

> Manually connect your Google Analytics data to the Developer Data framework to resolve connection failures or customize data export settings.

If your Google Analytics account doesn't connect to the Unity Dashboard through the [guided setup process](/cloud/developer-data/link-google-analytics.md), then you can manually retry the connection process.

> **Note:**
>
> The guided setup process performs the following steps on your behalf. Before you try the manual connection process, refer to [Automatically retry an unsuccessful connection](/cloud/developer-data/link-google-analytics.md#automatically-retry-an-unsuccessful-connection).

> **Important:**
>
> The following concerns a product or service (each a “Third Party Product”) that is not developed, owned, or operated by Unity. This information may not be up-to-date or complete, and is provided to you for your information and convenience only. Your access and use of any Third Party Product is governed solely by the terms and conditions of such Third Party Product. Unity makes no express or implied representations or warranties regarding such Third Party Products, and will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss arising from your use thereof (including damage or loss arising from any content, advertising, products or other materials on or available from the provider of any Third Party Products).

## Determine which manual connection method to follow

Which method you use to manually connect Google Analytics depends on whether you have an existing BigQuery export.

To determine which method to use, follow these steps:

1. In [Google Analytics](https://analytics.google.com), go to **Admin** (gear icon) > **Product links** > **BigQuery links**.
2. Under **Project ID**, identify the destination project:

* If the project ID is `unity-firebase-bq-links-prd`, then proceed to [Google Analytics setup without an existing BigQuery export](#google-analytics-setup-without-an-existing-bigquery-export).
* If any other Google Cloud project ID is displayed, then proceed to [Google Analytics setup with an existing BigQuery export](#google-analytics-setup-with-an-existing-bigquery-export).

## Google Analytics setup without an existing BigQuery export

Follow this process if you don't have an existing BigQuery export, and BigQuery is linked to the project ID `unity-firebase-bq-links-prd` in Google Analytics.

Before you begin, make sure you have the following:

* The Owner or Manager role in the organization that the Unity project belongs to in the Unity Dashboard
* The Administrator role on the Google Analytics property
* The Google Analytics [property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id#google_analytics)

### Grant the service account access to the Google Analytics property

Unity uses a per-property service account to create and manage the BigQuery link.

To give the service account access to the Google Analytics property, follow these steps:

1. In [Google Analytics](https://analytics.google.com), go to **Admin** (gear icon) > **Property** > **Property access management**.
2. Select **Add access permissions to new users** (+ icon).
3. Select **Add users**.
4. Enter the service account email address `ga-link-{propertyId}@unity-firebase-bq-links-prd.iam.gserviceaccount.com`, making sure to replace the placeholder `{propertyId}` with your Google Analytics property ID number. For example, `ga-link-540022283@unity-firebase-bq-links-prd.iam.gserviceaccount.com`.
5. Deselect **Notify new users by email**.
6. Under **Direct roles and data restrictions**, select **Editor**.
7. Select **Add**.

After you add the service account, the **Property access management** window displays the service account email address with the Editor role.

### Verify the link export settings ##verify-no-export

To verify the link export settings, follow these steps:

1. In [Google Analytics](https://analytics.google.com), go to **Admin** (gear icon) > **Product links** > **BigQuery links**.
2. Select the BigQuery link for your property.
3. Turn on the following settings:
   * **Streaming Export**
   * **Include Advertising ID**
4. Under **Export Streams**, confirm that the configured data streams are listed.
5. Select **Save**.

After you verify the link export settings in Google Analytics, you need to verify the connection in the Unity Dashboard.

To verify the connection, follow these steps:

1. In the [Unity Dashboard](https://cloud.unity.com/), go to **Projects** > **Settings**.
2. In the **Developer Data** section, locate **Google Analytics (Firebase)**.
3. Select **View link**.
4. In the **Auto-fix integration** section, select **Run auto-fix**.
5. Select **Update Link**.

After you save your changes, the Unity Dashboard's link verification displays the message `Service account has editor role on GA property`.

## Google Analytics setup with an existing BigQuery export

Follow this process if you have an existing BigQuery export linked to a Google Cloud project.

Before you begin, make sure you have the following:

* The Owner or Manager role in the organization that the Unity project belongs to in the Unity Dashboard
* The Google Analytics [property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id#google_analytics)
* The destination project ID identified in **BigQuery links**
* One of the following user roles in Google Cloud Console Identity and Access Management (GCP IAM): Owner, BigQuery Admin, or BigQuery Data Owner

### Grant the export service account read access to the dataset

Unity uses an export service account to read the property's data from the `analytics_{propertyId}` dataset in your project.

To grant the service account access to the dataset, follow these steps:

1. In [Google Cloud Console](http://console.cloud.google.com/bigquery), select the destination BigQuery project linked in Google Analytics.
2. In the **Explorer** panel, select the dataset `analytics_{propertyId}`. For example, `analytics_540022283`.
3. Select **Sharing** > **Permissions**.
4. Select **Add Principal**.
5. In **New principals**, enter `big-query-link-creator@unity-firebase-bq-links-prd.iam.gserviceaccount.com`.
6. In the **Role** dropdown, select **BigQuery Data Viewer** (`roles/bigquery.dataViewer`).
7. Select **Save**.

> **Note:**
>
> Grant the BigQuery Data Viewer role only on the dataset, not on the whole project. The export needs to read only the `analytics_{propertyId}` dataset.

After you save your changes, the service account appears under **Permissions** with the BigQuery Data Viewer role.

### Verify the link export settings ##verify-with-export

To verify the link export settings, follow these steps:

1. In [Google Analytics](https://analytics.google.com), go to **Admin** (gear icon) > **Product links** > **BigQuery links**.
2. Select the BigQuery link for your property.
3. Turn on **Include Advertising ID**.
4. Under **Export Streams**, confirm that the configured data streams are listed.
5. Select **Save**.

After you save your changes, the Unity Dashboard's link verification displays the message `Service account has BigQuery access`.

The BigQuery dataset `analytics_{propertyId}` is automatically created by Google Analytics within 24 to 48 hours after linking. To confirm the status of the dataset, check in [BigQuery Console](https://console.cloud.google.com/bigquery) under the project ID.

If Google Analytics isn't connected to the Developer Data framework after you follow both the [automatic](/cloud/developer-data/link-google-analytics.md) and [manual](/cloud/developer-data/link-google-analytics-manual.md) connection methods, then refer to [Troubleshooting your Google Analytics connection to the Developer Data framework](/cloud/developer-data/google-analytics-troubleshooting.md).
