Skip to main content

Airbyte Google-Analytics-Data-Api Connector for AI platforms

Project description

Google-Analytics-Data-Api

The Google-Analytics-Data-Api agent connector is a Python package that equips AI agents to interact with Google-Analytics-Data-Api through strongly typed, well-documented tools. It's ready to use directly in your Python app, in an agent framework, or exposed through an MCP.

Google Analytics 4 (GA4) Data API connector for accessing website and app analytics data. This connector provides access to pre-configured analytics reports including website overview, active users, traffic sources, page performance, device breakdowns, and geographic locations. Reports are retrieved via the GA4 Data API v1beta using configurable date ranges and property IDs. Requires OAuth2 authentication with Google Analytics read-only scope.

Example questions

The Google-Analytics-Data-Api connector is optimized to handle prompts like these.

  • 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?

Unsupported questions

The Google-Analytics-Data-Api connector isn't currently able to handle prompts like these.

  • Create a new GA4 property
  • Delete analytics data
  • Modify tracking configurations
  • Run a custom report with arbitrary dimensions
  • Access real-time analytics data

Installation

uv pip install airbyte-agent-google-analytics-data-api

Usage

Connectors can run in open source or hosted mode.

Open source

In open source mode, you provide API credentials directly to the connector.

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>"
    )
)

@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 {})

Hosted

In hosted mode, API credentials are stored securely in Airbyte Cloud. You provide your Airbyte credentials instead. If your Airbyte client can access multiple organizations, also set organization_id.

This example assumes you've already authenticated your connector with Airbyte. See Authentication to learn more about authenticating. If you need a step-by-step guide, see the hosted execution tutorial.

from airbyte_agent_google_analytics_data_api import GoogleAnalyticsDataApiConnector, AirbyteAuthConfig

connector = GoogleAnalyticsDataApiConnector(
    auth_config=AirbyteAuthConfig(
        customer_name="<your_customer_name>",
        organization_id="<your_organization_id>",  # Optional for multi-org clients
        airbyte_client_id="<your-client-id>",
        airbyte_client_secret="<your-client-secret>"
    )
)

@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 {})

Full documentation

Entities and actions

This connector supports the following entities and actions. For more details, see this connector's full reference documentation.

Entity Actions
Website Overview List, Search
Daily Active Users List, Search
Weekly Active Users List, Search
Four Weekly Active Users List, Search
Traffic Sources List, Search
Pages List, Search
Devices List, Search
Locations List, Search

Authentication

For all authentication options, see the connector's authentication documentation.

Google-Analytics-Data-Api API docs

See the official Google-Analytics-Data-Api API reference.

Version information

  • Package version: 0.1.1
  • Connector version: 1.0.1
  • Generated with Connector SDK commit SHA: 9072a725853114e466154114543292f4c8efe9f3
  • Changelog: View changelog

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airbyte_agent_google_analytics_data_api-0.1.1.tar.gz (144.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file airbyte_agent_google_analytics_data_api-0.1.1.tar.gz.

File metadata

File hashes

Hashes for airbyte_agent_google_analytics_data_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1cdd99c59e9f42b728d14677edf911dc6f56594acca221ed9a2de0dcce6da32e
MD5 ea97d0debd525aa784a8416abad7edc9
BLAKE2b-256 0fc901dc9ac1ba68aec4d4dcdfd7751a881bfe9c53e1438727c4c73074d8f979

See more details on using hashes here.

File details

Details for the file airbyte_agent_google_analytics_data_api-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for airbyte_agent_google_analytics_data_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d19afa8992dd63f987c36a1f16f848cc988602b32546e0693829d90374330aed
MD5 57f3397f47757185e5c59ca1d1af6ce6
BLAKE2b-256 4131b2ca65df7a1953099b73e39ec7b8d7672439220f2acbba111d673a629c42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page