> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: Google Analytics 4 (GA4) Source

> Configure the Google Analytics 4 source component to read analytics report data from your GA4 property in Integrate.io ETL data pipelines.

## Connection Setup

## Step 1: Create a Service Account within your GCP project

### Create a Service Account

<Steps>
  <Step>
    Access your [Google Cloud Console](https://console.cloud.google.com/#/project).
  </Step>

  <Step>
    On the sidebar, choose [IAM & Admin > Service Accounts.](https://console.cloud.google.com/iam-admin/serviceaccounts)
  </Step>

  <Step>
    Click [+ CREATE SERVICE ACCOUNT.](https://console.cloud.google.com/iam-admin/serviceaccounts/create)
  </Step>

  <Step>
    Fill up the Service account details and click "**Done**".

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-97.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=cd3e739c275ea37f0e901747784be59e" alt="GCP service account creation form with account details" width="1200" height="870" data-path="images/connectivity-and-security/image-97.webp" />
    </Frame>
  </Step>
</Steps>

### Generate a private key for your service account

<Steps>
  <Step>
    Navigate to [IAM & Admin > Service Accounts.](https://console.cloud.google.com/iam-admin/serviceaccounts)
  </Step>

  <Step>
    Click the Service Account you created from the previous step.
  </Step>

  <Step>
    Click the **"KEYS"** tab.
  </Step>

  <Step>
    Click "**ADD KEY"** > "**Create new key**" > **"JSON"** and click "**CREATE**".
  </Step>

  <Step>
    A private key (JSON) file will be automatically downloaded to your machine.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-98.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=3fffe17af9bcd1bc2034066ce45ef84e" alt="JSON private key download dialog for the service account" width="1942" height="1158" data-path="images/connectivity-and-security/image-98.webp" />
    </Frame>
  </Step>
</Steps>

## Step 2: Enable the APIs

<Steps>
  <Step>
    Enable [Google Analytics Admin API](https://console.cloud.google.com/marketplace/product/google/analyticsadmin.googleapis.com)

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-99.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=17d10dba57888d38291f38548e7016c6" alt="Enabling the Google Analytics Admin API in Cloud Console" width="1200" height="1060" data-path="images/connectivity-and-security/image-99.webp" />
    </Frame>
  </Step>

  <Step>
    Enable [Google Analytics Data API](https://console.cloud.google.com/marketplace/product/google/analyticsdata.googleapis.com)

    <Frame>
      <img src="https://mintcdn.com/integrateio/XpeHmuMzUiEmfOEz/images/connectivity-and-security/image-100.webp?fit=max&auto=format&n=XpeHmuMzUiEmfOEz&q=85&s=a795369613cbae64416f87f7762e9243" alt="Enabling the Google Analytics Data API in Cloud Console" width="1200" height="1124" data-path="images/connectivity-and-security/image-100.webp" />
    </Frame>
  </Step>
</Steps>

## Step 3: Grant Google Analytics 4 Property Access to Service Account

<Steps>
  <Step>
    Navigate to [Google Analytics](https://analytics.google.com/) and click on the "**Admin**" cog in the left sidebar.
  </Step>

  <Step>
    Ensure that you are in the correct Account and Property, and then click on "**Property Access Management**".
  </Step>

  <Step>
    Click on the blue **+** button to add access permissions to new users, and select "Add users".
  </Step>

  <Step>
    Paste the Service Account email address you created earlier. Deselect "**Notify new users by email**" and select "**Viewer**" and click "**Create**".
  </Step>
</Steps>

## Step 4: Create GA4 Connection on Integrate.io ETL

<Steps>
  <Step>
    Navigate to the **Connections** tab and click **Google Analytics - GA4.**

    <Frame>
      <img src="https://mintcdn.com/integrateio/XpeHmuMzUiEmfOEz/images/connectivity-and-security/image-101.webp?fit=max&auto=format&n=XpeHmuMzUiEmfOEz&q=85&s=cf279ba819ec5c354576c947dc4d0e1c" alt="Connections tab showing available connection types" width="1200" height="829" data-path="images/connectivity-and-security/image-101.webp" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/integrateio/XpeHmuMzUiEmfOEz/images/connectivity-and-security/image-102.webp?fit=max&auto=format&n=XpeHmuMzUiEmfOEz&q=85&s=8a182700b140aa3867980503bd4f336e" alt="Selecting Google Analytics GA4 from the connection list" width="1200" height="829" data-path="images/connectivity-and-security/image-102.webp" />
    </Frame>
  </Step>

  <Step>
    Fill up the Connection Name.
  </Step>

  <Step>
    Upload the JSON key you generated from Step 1.
  </Step>

  <Step>
    Click **Test Connection** and **Create Connection**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/XpeHmuMzUiEmfOEz/images/connectivity-and-security/image-103.webp?fit=max&auto=format&n=XpeHmuMzUiEmfOEz&q=85&s=7a95ae9421fd35c390fe09548225e8c3" alt="GA4 connection form with name and JSON key upload" width="1200" height="829" data-path="images/connectivity-and-security/image-103.webp" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/integrateio/XpeHmuMzUiEmfOEz/images/connectivity-and-security/image-104.webp?fit=max&auto=format&n=XpeHmuMzUiEmfOEz&q=85&s=f9695fa38832156fbd3721c6e702fe76" alt="GA4 connection test successful with Create Connection button" width="1200" height="829" data-path="images/connectivity-and-security/image-104.webp" />
    </Frame>
  </Step>
</Steps>

***

<Frame>
  <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-google-analytics-4-ga4-source/image-1.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=e7fce4c0eb6bbb03839a3cab39188a3a" alt="Google Analytics 4 source component in the pipeline designer" width="1200" height="828" data-path="images/creating-packages/using-components-google-analytics-4-ga4-source/image-1.png" />
</Frame>

## Connection

Select an existing Google Analytics 4 (GA4) connection or create a new one.

## Source Properties

<Frame>
  <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-google-analytics-4-ga4-source/image-2.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=bbe67e2e594ae36505f5bb422bbdab2d" alt="GA4 source properties with API version, date range, and property IDs" width="1200" height="828" data-path="images/creating-packages/using-components-google-analytics-4-ga4-source/image-2.png" />
</Frame>

* **Api Version -** Select api version Google Analytics 4 API. See list of available APIs from Google [here](https://developers.google.com/analytics/devguides/reporting/data/v1/rest)
* **Date range** - Select a date range from the dropdown list of ranges. If you select `custom date range...`, you will be prompted to enter From date and To date. Click on either inputs and select the dates from the calendar. You can also use variables as values for the custom date range in the format `yyyy-MM-dd`.
* **Include custom dimensions and metrics -** Fetch list of custom dimensions and metrics from selected accounts and show it on tables of dimensions and metrics in schema section
* **Property IDs** - Leave empty to read data for all accessible Google Analytics 4 properties or type in the IDs of your Google Analytics properties (or tables) in the form of properties/xxx. You can enter multiple ids separated by comma or use a variable too. Source Schema

Select the metrics and dimensions to use in the source. The source also includes pre-defined fields for the Google Analytics account name, property name, property id and account id. Data can be also previewed by clicking "Refresh" button.

<Frame>
  <img src="https://mintcdn.com/integrateio/OwEKdS5aIKsEcmhX/images/creating-packages/using-components-google-analytics-4-ga4-source/image-3.png?fit=max&auto=format&n=OwEKdS5aIKsEcmhX&q=85&s=d05470492bca4a9433cd87673fc32235" alt="GA4 source schema with metrics and dimensions selection" width="1196" height="1083" data-path="images/creating-packages/using-components-google-analytics-4-ga4-source/image-3.png" />
</Frame>

## Migrating from Universal Analytics to Google Analytics 4 (GA4)

For metrics and dimensions mapping, please visit GA4 migration guide [here](https://developers.google.com/analytics/devguides/migration/api/reporting-ua-to-ga4-dims-mets)
