Product analytics connector
Google Analytics connector for governed AI agent access
Connect Google Analytics with either Google OAuth tokens or a Google Cloud service account JSON key.
Direct answer
OneQuery supports Google Analytics for governed agent access.
Teams use the Google Analytics connector to give AI agents bounded source API calls for endpoint-specific context while OneQuery keeps credentials centralized, limits access to approved sources, and preserves audit logs for review.
Agent workflow
What this connector enables
Google Analytics becomes an approved OneQuery source instead of a secret copied into an agent prompt, shell session, or model tool. The agent receives a governed access path, and the source credentials stay behind OneQuery.
- Use bounded source API calls for endpoint-specific context for product analytics context.
- Keep Google Analytics credentials centralized and out of agent runtimes.
- Review agent access through OneQuery audit history instead of reconstructing direct service usage.
Setup checklist
Prepare the Google Analytics connection
Use ga credentials and connect the source through the Dashboard and CLI. Keep credentials scoped to the data the agent is allowed to read.
- Retrieve the GA4 `propertyId` from `Admin > Property details`.
- For the live service-account flow, create a Google Cloud service account, create a JSON key, then add that service-account email as a GA4 Viewer.
- The CLI does not accept raw Google service-account JSON. Map the downloaded key into `serviceAccount.projectId`, `clientEmail`, `privateKey`, and optional `privateKeyId`.
- If you use OAuth instead, provide `accessToken`, `refreshToken`, and `expiresAt` with the Analytics readonly scope.
FAQ
Google Analytics connector questions
What is the OneQuery Google Analytics connector?
The OneQuery Google Analytics connector makes product analytics context from Google Analytics available to AI agents through bounded source API calls for endpoint-specific context. Connect Google Analytics with either Google OAuth tokens or a Google Cloud service account JSON key.
How do AI agents access Google Analytics through OneQuery?
Agents call OneQuery instead of receiving raw Google Analytics credentials. OneQuery keeps credentials centralized, applies source boundaries, and records access in audit logs while exposing bounded source API calls for endpoint-specific context.
How do I set up the Google Analytics connector?
Prepare ga credentials and connect Google Analytics from the OneQuery dashboard or CLI. Start with this setup step: Retrieve the GA4 `propertyId` from `Admin > Property details`.