Creating a Google API service account
- Create a service account on the Google APIs site https://console.developers.google.com/apis/credentials.
- Create credentials using a service account key that is a JSON key type. The key is downloaded as a JSON file. For more details on this process, see Creating credentials for a Google API service. You'll use this file in the section Configuring a site to retrieve Google Analytics 4 data.
- Grant your Service Account access to read from the Google Analytics account.
- Go to https://analytics.google.com/analytics/web/ and log in.
- Go to Google Analytics > Admin > Property Access Management
- Click the (+) at the upper right corner of the screen to add a user.
- Copy the service account email generated by Google when you set up your service account.
- Paste the service account email and add the Read & Analyze permission.
- Click Add on the upper right corner to save the configuration.
Creating a Google Analytics account
Creating credentials for a Google API service