Google Analytics Admin API
- URL
-
https://analyticsadmin.googleapis.com/ - Docs
- https://developers.google.com/analytics/devguides/config/admin/v1/rest
Authorization: Bearer <credential> In Google Cloud Console, create an OAuth 2.0 Client ID for your app under APIs & Services → Credentials. Enable the Google Analytics Admin API for the same project, configure the consent screen if prompted, and request Analytics scopes such as https://www.googleapis.com/auth/analytics.edit or https://www.googleapis.com/auth/analytics.readonly as needed. Then use Google's standard OAuth 2.0 web-server flow documented at Using OAuth 2.0 for Web Server Applications to obtain bearer access tokens.
Authorization: Bearer <credential> In Google Cloud Console, create a service account for your project, grant it access to the relevant Google Analytics resources, and create a key if your environment needs one. Then follow Using OAuth 2.0 for Service Account Applications to mint OAuth 2.0 bearer access tokens for Analytics scopes such as https://www.googleapis.com/auth/analytics.edit or https://www.googleapis.com/auth/analytics.readonly.