How to connect Google Analytics 4 to Windsor.ai using a Service Account

This guide explains how to connect your GA4 property to Windsor.ai using a Google Cloud Service Account, step-by-step.

Steps to connect GA4 to Windsor.ai through a Service Account

Step 1. Create a Google Cloud project

1. Go to Google Cloud Console and open the project picker on the top left side.

2. Click on ‘New project.’

create new project in google cloud

3. Name your project and click ‘Create.’

name your project in google cloud

The organization doesn’t matter—you can choose any.

Step 2. Create a Service Account

1. Access your Google Cloud Console.

2. On the sidebar, choose IAM & Admin -> Service Accounts.

IAM & Admin -> Service Accounts

3. Click + Create Service Account.

create service account in google cloud

4. Fill in the Service Account details and click ‘Done.’

new service account google cloud

After successfully creating a Service Account, you will see it in your list.

view service accounts in google cloud

The email associated with your Service Account will be used to get access to GA4. Save this email to use it in the next steps. 

Step 3. Generate a Service Account key

1. Navigate to IAM & Admin > Service Accounts.

2. Select the Service Account you created in the previous step.

  • Go to the ‘Keys’ tab.

Keys in google cloud

  • Click ‘Add key’ -> ‘Create new key’ -> ‘JSON’ -> ‘Create.’

create key in google cloud console

  • A private key (JSON) file will be automatically downloaded to your machine.

Note: You will only upload it to Windsor.ai. GA4 owners do not need it.

Step 4. Enable required Google Analytics APIs

First, you have to enable two Google APIs in the same Google Cloud project where you’ve created the Service Account.

1. Enable Google Analytics Admin API:

Go to Google Cloud Console -> API Library -> Google Analytics Admin API and click ‘Enable.’

2 Enable Google Analytics Data API:

Go to Google Cloud Console -> API Library -> Google Analytics Data API and click ‘Enable.’

Both APIs must be enabled in the same Google Cloud project as the Service Account. Admin API is used to discover GA4 accounts and properties. Data API is used to fetch GA4 report data.

Note: When enabling the Google Analytics Admin API and Data API, you will only see your project, not Service Account. Google APIs are enabled at the Google Cloud project level, not per Service Account.

Step 5. Grant GA4 access to the service account

1. Open Google Analytics and click the Admin gear in the left sidebar.

2. Confirm you are in the correct Account and Property, then open Property Access Management.

property access management in ga4

3. Click the blue + icon and choose Add users.

add new users to ga4 property

4. Paste the Service Account email you created earlier in Step 2. Uncheck Notify new users by email, set the role to Viewer, and click ‘Create.’

add roles to ga4 property

Important: If you manage the GA4 property, you can add the Service Account email yourself if you don’t want to use the “Sign in with Google” option. If someone else manages the GA4 property, ask them to add the Service Account email for you to share access. These steps are the same for both cases. 

Step 6. Connect GA4 to windsor.ai via a Service Account

1. Log in to your Windsor.ai account.

2. Navigate to the Data Sources search in the left-hand bar.

3. Find Google Analytics 4 (https://onboard.windsor.ai/app/googleanalytics4) in the list.

4. Click on the ‘Use Service Account’ button.

connect ga4 to windsor service account

 

5. Upload your private key (JSON) file created in Step 3.

6. After successfully connecting to the GA4, you will see a list of your available accounts.

Support

If you encounter issues while connecting or using the Google Analytics 4 (GA4) connector in Windsor.ai:

  • If using a Service Account, verify that:
    • The service account email is added to GA4 with Viewer or Analyst access.
    • Both the Google Analytics Admin API and Google Analytics Data API are enabled in the Google Cloud project.
  • Check GA4 Property access management for recent permission changes or removed users.
  • Review Google Cloud Console for disabled APIs, deleted keys, or revoked service accounts.
  • Frequently asked support questions and GA4 troubleshooting guides can be found here.
  • Contact Windsor.ai Support for connector setup, authorization, or data synchronization issues.
  • Contact Google Analytics or Google Cloud Support for GA4 property, permission, or API level issues.

FAQs

Should I use OAuth or a Service Account to connect GA4?

Use OAuth for quick testing or personal setups. Use a Service Account for production use, team environments, and stable long-term data syncs. Service accounts do not depend on personal Google logins.

Tired of juggling fragmented data? Get started with Windsor.ai today to create a single source of truth

Let us help you streamline data integration and AI insights, so you can focus on what matters—growth strategy.
g logo
fb logo
big query data
youtube logo
power logo
looker logo