At a glance
- Availability: Experimental (how to enable).
- Authentication: OAuth 2.0.
- Connection: A user authorizes the connection in the provider’s consent screen.
- Scopes:
https://www.googleapis.com/auth/analytics.readonly. - Provider documentation: Authentication reference.
Credentials
Set these per environment. See Connect an integration. These variables are required only when you supply your own OAuth app. If a managed app is available, you can connect without setting them. Provider permissions and consent still apply.Setup
- Create or reuse a Google Cloud project: Go to https://console.cloud.google.com and select or create the project that holds your OAuth credentials.
- Enable the Analytics APIs: Enable both the Google Analytics Data API and the Google Analytics Admin API in the API Library.
- Configure OAuth credentials: Under APIs & Services → Credentials, create (or reuse) an OAuth 2.0 Client ID of type Web application and add your callback URL (e.g. https://your-app.example.com/api/auth/google-analytics/callback) to the authorized redirect URIs.
- Set environment variables: Add GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to your .env. These are shared with the other Google connectors (Calendar, Gmail, Drive, Sheets).
- Verify access: Connect your Google account, run List Account Summaries to find a property ID, then run a report with metrics [{“name”:“activeUsers”}] and dateRanges [{“startDate”:“7daysAgo”,“endDate”:“today”}].
Provider notes
- This connector is read-only (analytics.readonly scope) and targets GA4 properties; Universal Analytics is sunset
- Property IDs are numeric (e.g. 123456789) - not the G-XXXX measurement ID
Tools
Verify the connection
Call a read tool such asgoogle-analytics__list_account_summaries with arguments for your account. Confirm that the result comes from the intended account or workspace before enabling write tools.