Installation & Usage
[01]
Install Package
Using uv or pip
BASH
uv pip install airbyte-agent-google-analytics-data-api
[02]
Import
Initialize and use
PYTHON
from airbyte_agent_google_analytics_data_api import GoogleAnalyticsDataApiConnector
from airbyte_agent_google_analytics_data_api.models import GoogleAnalyticsDataApiAuthConfig
connector = GoogleAnalyticsDataApiConnector(
auth_config=GoogleAnalyticsDataApiAuthConfig(
client_id="<OAuth 2.0 Client ID from Google Cloud Console>",
client_secret="<OAuth 2.0 Client Secret from Google Cloud Console>",
refresh_token="<OAuth 2.0 Refresh Token for obtaining new access tokens>"
)
)
[03]
Tool
Add tools to your agent
python
@agent.tool_plain # assumes you're using Pydantic AI
@GoogleAnalyticsDataApiConnector.tool_utils
async def google_analytics_data_api_execute(entity: str, action: str, params: dict | None = None):
return await connector.execute(entity, action, params or {})
Supported Entities & Actions
Lorem ipsum
Lorem ipsum
| Entity | Actions |\n|--------|---------|\n| Website Overview | [List](./REFERENCE.md#website-overview-list), [Search](./REFERENCE.md#website-overview-search) |\n| Daily Active Users | [List](./REFERENCE.md#daily-active-users-list), [Search](./REFERENCE.md#daily-active-users-search) |\n| Weekly Active Users | [List](./REFERENCE.md#weekly-active-users-list), [Search](./REFERENCE.md#weekly-active-users-search) |\n| Four Weekly Active Users | [List](./REFERENCE.md#four-weekly-active-users-list), [Search](./REFERENCE.md#four-weekly-active-users-search) |\n| Traffic Sources | [List](./REFERENCE.md#traffic-sources-list), [Search](./REFERENCE.md#traffic-sources-search) |\n| Pages | [List](./REFERENCE.md#pages-list), [Search](./REFERENCE.md#pages-search) |\n| Devices | [List](./REFERENCE.md#devices-list), [Search](./REFERENCE.md#devices-search) |\n| Locations | [List](./REFERENCE.md#locations-list), [Search](./REFERENCE.md#locations-search) |
Example Prompts
Lorem ipsum
Show me the website overview report - List daily active users - Show weekly active user trends - Get the four-weekly active users report - List traffic sources - Show me page performance metrics - Get device breakdown data - List user locations - What are the top traffic sources by sessions? - Which pages have the highest bounce rate? - What devices do most users browse from? - Which countries send the most traffic? - How has daily active users changed over the last month?
Why Airbyte for AI Agents?
Built for production AI workloads with enterprise-grade reliability
Secure Authentication
Built-in OAuth 2.0 handling with automatic token refresh. No hard-coded credentials.
Agent-Native Design
Heading
Structured, LLM-friendly schemas optimized for AI agent consumption with natural language query support.
Production Ready
Battle-tested connectors with comprehensive error handling, logging, and retry logic.
Open Source
Fully open source under the MIT license. Contribute, customize, and extend freely.
Works with your favorite frameworks
LangChain
CrewAI
LlamaIndex
AutoGen
OpenAI Agents SDK
Claude Agents SDK
Frequently Asked Questions
Didn't find your answer? Please don't hesitate to reach out.
The Google Analytics Data API connector supports OAuth 2.0 authentication. You must provide a Client ID, Client Secret, and a Refresh Token obtained from the Google Cloud Console with the Google Analytics read-only scope.
Can I use this connector with any AI agent framework?
The connector is compatible with any Python-based AI agent framework including LangChain, LlamaIndex, CrewAI, Pydantic AI, and custom implementations.
Does this connector support write operations?
No, the Google Analytics Data API connector does not support write operations. It is read-only and focused on retrieving analytics reports. Unsupported operations include creating GA4 properties, deleting analytics data, modifying tracking configurations, and accessing real-time analytics data.
How is this different from the Airbyte data connector?
Agent connectors are specifically designed for AI agents and LLM applications. They provide natural language interfaces, optimized response formats, and seamless integration with agent frameworks, unlike traditional ETL-focused connectors.
Get started in minutes with our open-source connector.