Summary: This document provides a high level overview of the Google Analytics Admin API Version 1.0.
Introduction
The Google Analytics Admin API allows for programmatic access to the Google Analytics 4 (GA4) configuration data and is only compatible with GA4 properties. Learn more about GA4 properties.
You can use the Google Analytics Admin API to:
- Provision new accounts
- List, Manage, and Delete accounts
- List account summaries
- List, Create, Manage, and Delete GA4 properties.
- Change Google Analytics data sharing settings for GA4 properties.
- Create, Manage, and Delete Web, Android, iOS data streams inside GA4 properties.
- Generate a Global Site Tag snippet for Web data streams inside GA4 properties.
- Manage enhanced measurement settings for Web data streams inside GA4 properties.
- Manage Links between GA4 properties and Firebase projects.
- Manage Links between GA4 properties and Google Ads accounts.
- Manage user permissions for an account hierarchy and GA4 properties.
- Audit user permissions including implicit ones that come from effective permissions granted by groups or organization admin roles.
Available methods
Account provisioning
accounts.provisionAccountTicket
This method returns the
accountTicketId
field that should be included in the Terms of Service (TOS) URL:https://analytics.google.com/analytics/web/?provisioningSignup=false#/termsofservice/ACCOUNT_TICKET_ID
. Once a user visits the TOS URL and accepts the Terms of Service, creation of a Google Analytics account will be complete (Account provisioning sample).
Account management
Account summaries
User permissions management
- accounts.userLinks.list
- accounts.userLinks.create
- accounts.userLinks.batchDelete
- accounts.userLinks.batchCreate
- accounts.userLinks.get
- accounts.userLinks.patch
- accounts.userLinks.batchUpdate
- accounts.userLinks.delete
Account data sharing settings management
User permission audit
GA4 properties management
Firebase project linking
- properties.firebaseLinks.delete
- properties.firebaseLinks.patch
- properties.firebaseLinks.list
- properties.firebaseLinks.create
Google Ads account linking
- properties.googleAdsLinks.delete
- properties.googleAdsLinks.patch
- properties.googleAdsLinks.list
- properties.googleAdsLinks.create
GA4 data streams management
- properties.androidAppDataStreams.delete
- properties.androidAppDataStreams.get
- properties.androidAppDataStreams.patch
- properties.androidAppDataStreams.list
- properties.androidAppDataStreams.create
- properties.webDataStreams.delete
- properties.webDataStreams.list
- properties.webDataStreams.create
- properties.webDataStreams.get
- properties.webDataStreams.patch
- properties.iosAppDataStreams.delete
- properties.iosAppDataStreams.get
- properties.iosAppDataStreams.patch
- properties.iosAppDataStreams.list
- properties.iosAppDataStreams.create
Global Site Tag generation
Enhanced measurement settings management
- properties.webDataStreams.updateEnhancedMeasurementSettings
- properties.webDataStreams.getEnhancedMeasurementSettings
Enable the API
Click this button to automatically enable the Google Analytics Admin API:
Enable the Google Analytics Admin APIQuick start guide
Quick start using client libraries
API discovery document
You can query the Google Analytics Admin API discovery document by using the following URL:
https://analyticsadmin.googleapis.com/$discovery/rest?version=v1alpha
Client libraries
See the Quick start guide for examples of using the client libraries.
Java
Python
Node.js
Ruby
Go
go get google.golang.org/genproto/googleapis/analytics/admin/v1alpha