Google Analytics

How to find Property ID
To find your Google Analytics Property ID:
Sign in to your Google Analytics account.
Select the Admin gear icon located at the bottom left of the screen.
In the "Property settings" section, select "Property details".
The Property ID is displayed on the top right of the screen. It is a purely numeric identifier for the entire property container (e.g.,
123456789).
How to find service account JSON
Go to the Google Cloud Console.
Create a new project or select an existing project.
Navigate to the "IAM & Admin" section and select "Service Accounts."
Click "Create Service Account."
Enter a Service Account name and description, then click "Create."
Assign roles as needed, such as "Viewer" for read-only access.
Click "Done" after configuring roles.
In the "Actions" column for your service account, click the three-dot menu and select "Manage keys."
Click "Add Key," choose "JSON," and click "Create."
Download the JSON file to your computer. This file contains the credentials for your service account.
How to enable API access
Open Google Cloud Console and select the GCP project that owns your service account.
Go to APIs & Services → Library.
Search for "Google Analytics Data API" and click Enable.
(Recommended) Also enable "Google Analytics Admin API" for metadata access.
Confirm both APIs appear under APIs & Services → Enabled APIs for the same project.
How to grant the Service Account access in GA4
Copy the client_email value from your service account JSON (ends with .iam.gserviceaccount.com).
Open Google Analytics and navigate to Admin for the correct GA4 property.
Select Property access management.
Click "Add users" and paste the service account email.
Assign the Editor role (recommended for setup; you can downgrade to Viewer later).
Save changes.
Last updated
Was this helpful?