Skip to main content

Module airbyte_agent_sdk.connectors.google_analytics_data_api.connector

Google-Analytics-Data-Api connector.

Classes​

DailyActiveUsersQuery(connector: GoogleAnalyticsDataApiConnector) : Query class for DailyActiveUsers entity operations.

Initialize query with connector reference.

Methods​

context_store_search(self, query: DailyActiveUsersSearchQuery, limit: int | None = None, cursor: str | None = None, fields: list[list[str]] | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[DailyActiveUsersSearchData] : Search daily_active_users records from Airbyte cache.

This operation searches cached data from Airbyte syncs. Only available in hosted execution mode.

Available filter fields (DailyActiveUsersSearchFilter):

  • active1_day_users: Number of distinct users active in the last 1 day
  • date: Date of the report row in YYYYMMDD format
  • end_date: End date of the reporting period
  • property_id: GA4 property ID
  • start_date: Start date of the reporting period

Args: query: Filter and sort conditions. Supports operators such as eq, neq, gt, gte, lt, lte, in, startswith, endswith, contains, array_contains, fuzzy, keyword, not, and, or. Example: {"filter": {"eq": {"status": "active"}}} limit: Maximum results to return (default 1000) cursor: Pagination cursor from previous response's meta.cursor fields: Field paths to include in results. Each path is a list of keys for nested access. Example: [["id"], ["user", "name"]] returns id and user.name fields.

Returns: DailyActiveUsersSearchResult with typed records, pagination metadata, and optional search metadata

Raises: NotImplementedError: If called in local execution mode

context_store_sql_query(self, sql: str, limit: int | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[dict[str, Any]] : Run a SQL query against daily_active_users records in the Airbyte Context Store.

Only available in hosted execution mode.

Args: sql: SQL query to execute. limit: Maximum results to return.

Returns: AirbyteSearchResult containing the projected rows and query metadata.

Raises: NotImplementedError: If called in local execution mode.

list(self, property_id: str, date_ranges: list[DailyActiveUsersListParamsDaterangesItem] | None = None, dimensions: list[DailyActiveUsersListParamsDimensionsItem] | None = None, metrics: list[DailyActiveUsersListParamsMetricsItem] | None = None, keep_empty_rows: bool | None = None, return_property_quota: bool | None = None, limit: int | None = None, **kwargs) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiExecuteResultWithMeta[list[Row], DailyActiveUsersListResultMeta] : Returns daily active user counts (1-day active users) by date.

Args: date_ranges: Date ranges of data to read, in YYYY-MM-DD or relative format (e.g., 30daysAgo, today). Defaults to the last 30 days. dimensions: GA4 dimensions to group results by. Defaults match the equivalent Data Replication report. metrics: GA4 metrics to aggregate. Defaults match the equivalent Data Replication report. keep_empty_rows: If false, rows whose metrics are all zero are omitted from the response. return_property_quota: Whether to include the Analytics property's current quota state in the response. limit: Maximum number of rows to return (the GA4 API caps a single request at 250,000 rows). property_id: GA4 property ID **kwargs: Additional parameters

Returns: DailyActiveUsersListResult

DevicesQuery(connector: GoogleAnalyticsDataApiConnector) : Query class for Devices entity operations.

Initialize query with connector reference.

Methods​

context_store_search(self, query: DevicesSearchQuery, limit: int | None = None, cursor: str | None = None, fields: list[list[str]] | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[DevicesSearchData] : Search devices records from Airbyte cache.

This operation searches cached data from Airbyte syncs. Only available in hosted execution mode.

Available filter fields (DevicesSearchFilter):

  • average_session_duration: Average duration of sessions in seconds
  • bounce_rate: Percentage of sessions that were single-page with no interaction
  • browser: The web browser used (e.g., Chrome, Safari, Firefox)
  • date: Date of the report row in YYYYMMDD format
  • device_category: The device category (desktop, mobile, tablet)
  • end_date: End date of the reporting period
  • new_users: Number of first-time users
  • operating_system: The operating system used (e.g., Windows, iOS, Android)
  • property_id: GA4 property ID
  • screen_page_views: Total number of screen or page views
  • screen_page_views_per_session: Average page views per session
  • sessions: Total number of sessions
  • sessions_per_user: Average number of sessions per user
  • start_date: Start date of the reporting period
  • total_users: Total number of unique users

Args: query: Filter and sort conditions. Supports operators such as eq, neq, gt, gte, lt, lte, in, startswith, endswith, contains, array_contains, fuzzy, keyword, not, and, or. Example: {"filter": {"eq": {"status": "active"}}} limit: Maximum results to return (default 1000) cursor: Pagination cursor from previous response's meta.cursor fields: Field paths to include in results. Each path is a list of keys for nested access. Example: [["id"], ["user", "name"]] returns id and user.name fields.

Returns: DevicesSearchResult with typed records, pagination metadata, and optional search metadata

Raises: NotImplementedError: If called in local execution mode

context_store_sql_query(self, sql: str, limit: int | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[dict[str, Any]] : Run a SQL query against devices records in the Airbyte Context Store.

Only available in hosted execution mode.

Args: sql: SQL query to execute. limit: Maximum results to return.

Returns: AirbyteSearchResult containing the projected rows and query metadata.

Raises: NotImplementedError: If called in local execution mode.

list(self, property_id: str, date_ranges: list[DevicesListParamsDaterangesItem] | None = None, dimensions: list[DevicesListParamsDimensionsItem] | None = None, metrics: list[DevicesListParamsMetricsItem] | None = None, keep_empty_rows: bool | None = None, return_property_quota: bool | None = None, limit: int | None = None, **kwargs) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiExecuteResultWithMeta[list[Row], DevicesListResultMeta] : Returns device-related metrics broken down by device category, operating system, browser, and date, including users, sessions, and page views.

Args: date_ranges: Date ranges of data to read, in YYYY-MM-DD or relative format (e.g., 30daysAgo, today). Defaults to the last 30 days. dimensions: GA4 dimensions to group results by. Defaults match the equivalent Data Replication report. metrics: GA4 metrics to aggregate. Defaults match the equivalent Data Replication report. keep_empty_rows: If false, rows whose metrics are all zero are omitted from the response. return_property_quota: Whether to include the Analytics property's current quota state in the response. limit: Maximum number of rows to return (the GA4 API caps a single request at 250,000 rows). property_id: GA4 property ID **kwargs: Additional parameters

Returns: DevicesListResult

FourWeeklyActiveUsersQuery(connector: GoogleAnalyticsDataApiConnector) : Query class for FourWeeklyActiveUsers entity operations.

Initialize query with connector reference.

Methods​

context_store_search(self, query: FourWeeklyActiveUsersSearchQuery, limit: int | None = None, cursor: str | None = None, fields: list[list[str]] | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[FourWeeklyActiveUsersSearchData] : Search four_weekly_active_users records from Airbyte cache.

This operation searches cached data from Airbyte syncs. Only available in hosted execution mode.

Available filter fields (FourWeeklyActiveUsersSearchFilter):

  • active28_day_users: Number of distinct users active in the last 28 days
  • date: Date of the report row in YYYYMMDD format
  • end_date: End date of the reporting period
  • property_id: GA4 property ID
  • start_date: Start date of the reporting period

Args: query: Filter and sort conditions. Supports operators such as eq, neq, gt, gte, lt, lte, in, startswith, endswith, contains, array_contains, fuzzy, keyword, not, and, or. Example: {"filter": {"eq": {"status": "active"}}} limit: Maximum results to return (default 1000) cursor: Pagination cursor from previous response's meta.cursor fields: Field paths to include in results. Each path is a list of keys for nested access. Example: [["id"], ["user", "name"]] returns id and user.name fields.

Returns: FourWeeklyActiveUsersSearchResult with typed records, pagination metadata, and optional search metadata

Raises: NotImplementedError: If called in local execution mode

context_store_sql_query(self, sql: str, limit: int | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[dict[str, Any]] : Run a SQL query against four_weekly_active_users records in the Airbyte Context Store.

Only available in hosted execution mode.

Args: sql: SQL query to execute. limit: Maximum results to return.

Returns: AirbyteSearchResult containing the projected rows and query metadata.

Raises: NotImplementedError: If called in local execution mode.

list(self, property_id: str, date_ranges: list[FourWeeklyActiveUsersListParamsDaterangesItem] | None = None, dimensions: list[FourWeeklyActiveUsersListParamsDimensionsItem] | None = None, metrics: list[FourWeeklyActiveUsersListParamsMetricsItem] | None = None, keep_empty_rows: bool | None = None, return_property_quota: bool | None = None, limit: int | None = None, **kwargs) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiExecuteResultWithMeta[list[Row], FourWeeklyActiveUsersListResultMeta] : Returns 28-day active user counts by date.

Args: date_ranges: Date ranges of data to read, in YYYY-MM-DD or relative format (e.g., 30daysAgo, today). Defaults to the last 30 days. dimensions: GA4 dimensions to group results by. Defaults match the equivalent Data Replication report. metrics: GA4 metrics to aggregate. Defaults match the equivalent Data Replication report. keep_empty_rows: If false, rows whose metrics are all zero are omitted from the response. return_property_quota: Whether to include the Analytics property's current quota state in the response. limit: Maximum number of rows to return (the GA4 API caps a single request at 250,000 rows). property_id: GA4 property ID **kwargs: Additional parameters

Returns: FourWeeklyActiveUsersListResult

GoogleAnalyticsDataApiConnector(auth_config: GoogleAnalyticsDataApiAuthConfig | AirbyteAuthConfig | BaseModel | None = None, on_token_refresh: Any | None = None) : Type-safe Google-Analytics-Data-Api API connector.

Auto-generated from OpenAPI specification with full type safety.

Initialize a new google-analytics-data-api connector instance.

Supports both local and hosted execution modes:

  • Local mode: Provide connector-specific auth config (e.g., GoogleAnalyticsDataApiAuthConfig)
  • Hosted mode: Provide AirbyteAuthConfig with client credentials and either connector_id or workspace_name

Args: auth_config: Either connector-specific auth config for local mode, or AirbyteAuthConfig for hosted mode on_token_refresh: Optional callback for OAuth2 token refresh persistence. Called with new_tokens dict when tokens are refreshed. Can be sync or async. Example: lambda tokens: save_to_database(tokens) Examples:

Local mode (direct API calls)

connector = GoogleAnalyticsDataApiConnector(auth_config=GoogleAnalyticsDataApiAuthConfig(client_id="...", client_secret="...", refresh_token="..."))

Hosted mode with explicit connector_id (no lookup needed)

connector = GoogleAnalyticsDataApiConnector( auth_config=AirbyteAuthConfig( airbyte_client_id="client_abc123", airbyte_client_secret="secret_xyz789", connector_id="existing-source-uuid" ) )

Hosted mode with lookup by workspace_name

connector = GoogleAnalyticsDataApiConnector( auth_config=AirbyteAuthConfig( workspace_name="user-123", organization_id="00000000-0000-0000-0000-000000000123", airbyte_client_id="client_abc123", airbyte_client_secret="secret_xyz789" ) )

Class variables​

connector_name : The type of the None singleton.

connector_version : The type of the None singleton.

sdk_version : The type of the None singleton.

Static methods​

agent_tool(role: AgentToolRole | None = None, *, inspect_tool: str | None = None, docs_tool: str | None = None, max_output_chars: int | None | Unset = UNSET, framework: FrameworkName = 'none', internal_retries: int = 0, should_internal_retry: Callable[[Exception, tuple[Any, ...], dict[str, Any]], bool] | None = None, exhausted_runtime_failure_message: Callable[[Exception, tuple[Any, ...], dict[str, Any]], str | None] | None = None) ‑> Callable[[~_F], ~_F] : Decorator for new user-written connector tool functions.

Use this when a tool needs a custom body or the framework lacks a native strategy. Instead of baking the full entity/action reference into the docstring, it instructs the agent to call this connector's inspect and docs tools before executing. Tool failures raise :class:airbyte_agent_sdk.AirbyteToolError by default (framework="none", no auto-detection) — pass framework=... to translate to a supported framework's signal instead.

Decorate three functions per connector — execute, inspect and docs. The role is inferred from each function's signature (extra parameters are allowed); a signature matching more than one role, a generic (*args, **kwargs) wrapper, or a callable whose signature cannot be read must pass the role explicitly:

  • (entity, action, ...) -> "execute"
  • (section, ...) -> "read_skill_docs"
  • () -> "inspect_connector"

Usage: connector = GoogleAnalyticsDataApiConnector(...)

@GoogleAnalyticsDataApiConnector.agent_tool() async def execute(entity: str, action: str, params: dict | None = None): return await connector.execute(entity=entity, action=action, params=params or {})

@GoogleAnalyticsDataApiConnector.agent_tool() async def inspect_connector(): return await connector.inspect_connector()

@GoogleAnalyticsDataApiConnector.agent_tool() async def read_skill_docs(section: str | None = None): return await connector.read_skill_docs(section)

Args: role: "execute" | "inspect_connector" | "read_skill_docs". None (default) infers the role from the decorated function's signature; an explicit role validates the canonical parameters are present (functions accepting **kwargs, or callables whose signature cannot be read, pass validation). inspect_tool: Exact registered name of the sibling inspect tool, woven into the execute docstring for tighter steering. Defaults to generic phrasing. docs_tool: Exact registered name of the sibling docs tool (see inspect_tool). max_output_chars: Max serialized output size before failing. Defaults per role: execute -> DEFAULT_MAX_OUTPUT_CHARS, docs tools -> None. framework: Translation target for tool failures. Defaults to "none" (raise AirbyteToolError); never auto-detects. internal_retries: How many transient runtime failures (429/5xx, network, timeout) to retry silently before surfacing. Forwarded to :func:airbyte_agent_sdk.translation.translate_exceptions. should_internal_retry: Optional predicate (error, args, kwargs) -> bool further restricting which retryable errors are safe for this specific tool. Forwarded to :func:airbyte_agent_sdk.translation.translate_exceptions. exhausted_runtime_failure_message: Optional callback (error, args, kwargs) -> str | None invoked after internal retries are exhausted or skipped. Forwarded to :func:airbyte_agent_sdk.translation.translate_exceptions.

tool_utils(func: _F | None = None, *, update_docstring: bool = True, max_output_chars: int | None = 100000, framework: FrameworkName | None = None, internal_retries: int = 0, should_internal_retry: Callable[[Exception, tuple[Any, ...], dict[str, Any]], bool] | None = None, exhausted_runtime_failure_message: Callable[[Exception, tuple[Any, ...], dict[str, Any]], str | None] | None = None) ‑> ~_F | Callable[[~_F], ~_F] : Deprecated. Add connector-specific documentation and runtime safeguards to one tool.

Kept for backwards compatibility with existing single-tool integrations; it is not removed and does not warn at runtime, but new code should use build_connector_tools or agent_tool below.

For new agents, prefer build_connector_tools. It returns progressive inspect_connector, read_skill_docs, and execute tools so the agent can load only the connector guidance it needs:

from airbyte_agent_sdk import build_connector_tools
from pydantic_ai import Agent

tools = build_connector_tools(connector, framework="pydantic_ai")
agent = Agent("openai:gpt-4o", tools=tools.as_list())

When a new integration needs custom tool bodies or a framework without native support, use agent_tool instead.

Legacy: one generated-description tool​

Existing integrations can keep using tool_utils for one broad execute tool with the connector's full generated catalog in its description:

from fastmcp import FastMCP

connector = GoogleAnalyticsDataApiConnector()
mcp = FastMCP("Connector Agent")

@mcp.tool()
@GoogleAnalyticsDataApiConnector.tool_utils
async def execute(entity: str, action: str, params: dict):
...

Configure documentation, output limits, framework translation, and retries when needed:

@mcp.tool()
@GoogleAnalyticsDataApiConnector.tool_utils(update_docstring=False, max_output_chars=None)
async def execute(entity: str, action: str, params: dict):
...

@mcp.tool()
@GoogleAnalyticsDataApiConnector.tool_utils(framework="pydantic_ai", internal_retries=2)
async def execute(entity: str, action: str, params: dict):
...

This decorator composes translate_exceptions for runtime wrapping, output-size checks, framework signal translation, and optional internal retries, then adds connector-specific docstring augmentation.

Args: update_docstring: When True, append connector capabilities to __doc__. max_output_chars: Max serialized output size before raising. Use None to disable. framework: One of "pydantic_ai" | "langchain" | "openai_agents" | "mcp" | "none". Defaults to None, which auto-detects each framework's canonical import in order and falls back to "none" with a warning when no supported framework is installed. Explicit always wins, and an explicit framework whose package is missing raises RuntimeError. internal_retries: How many transient runtime failures (429/5xx, network, timeout) to retry silently before surfacing. Default 0. Forwarded to airbyte_agent_sdk.translation.translate_exceptions. should_internal_retry: Optional predicate (error, args, kwargs) -> bool further restricting which retryable errors are safe for this specific tool. Forwarded to airbyte_agent_sdk.translation.translate_exceptions. exhausted_runtime_failure_message: Optional callback (error, args, kwargs) -> str | None. Invoked after internal retries are exhausted or were skipped because should_internal_retry returned False. Forwarded to airbyte_agent_sdk.translation.translate_exceptions.

Instance variables​

connector_id: str | None : Get the connector/source ID (only available in hosted mode).

Returns: The connector ID if in hosted mode, None if in local mode.

Methods​

check(self) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiCheckResult : Perform a health check to verify connectivity and credentials.

Executes a lightweight list operation (limit=1) to validate that the connector can communicate with the API and credentials are valid.

Returns: GoogleAnalyticsDataApiCheckResult with status ("healthy" or "unhealthy") and optional error message

Example: result = await connector.check() if result.status == "healthy": print("Connection verified!") else: print(f"Check failed: {result.error}")

close(self) : Close the connector and release resources.

entity_schema(self, entity: str) ‑> dict[str, typing.Any] | None : Get the JSON schema for an entity.

Args: entity: Entity name (e.g., "contacts", "companies")

Returns: JSON schema dict describing the entity structure, or None if not found.

Example: schema = connector.entity_schema("contacts") if schema: print(f"Contact properties: {list(schema.get('properties', {}).keys())}")

execute(self, entity: str, action: "Literal['list', 'context_store_search', 'context_store_sql_query']", params: Mapping[str, Any] | None = None, *, select_fields: list[str] | None = None, exclude_fields: list[str] | None = None, skip_truncation: bool = True) ‑> Any : Execute an entity operation with full type safety.

This is the recommended interface for blessed connectors as it:

  • Uses the same signature as non-blessed connectors
  • Provides full IDE autocomplete for entity/action/params
  • Makes migration from generic to blessed connectors seamless

Args: entity: Entity name (e.g., "customers") action: Operation action (e.g., "create", "get", "list") params: Operation parameters (typed based on entity+action) select_fields: Optional allowlist of dot-notation fields to include exclude_fields: Optional blocklist of dot-notation fields to remove skip_truncation: Disable long-text truncation for collection actions

Returns: Typed response based on the operation

Example: customer = await connector.execute( entity="customers", action="get", params={"id": "cus_123"} )

inspect_connector(self) ‑> dict[str, typing.Any] : Inspect this connector's hosted metadata/readiness and resolve its docs skill id.

Call this before read_skill_docs in the normal hosted flow. For local/offline connectors this returns a local-mode payload with a warning instead of a hosted inspection.

Example: info = await connector.inspect_connector() print(info["docs_skill_id"])

list_entities(self) ‑> list[dict[str, typing.Any]] : Get structured data about available entities, actions, and parameters.

Returns a list of entity descriptions with:

  • entity_name: Name of the entity (e.g., "contacts", "deals")
  • description: Entity description from the first endpoint
  • available_actions: List of actions (e.g., ["list", "get", "create"])
  • parameters: Dict mapping action -> list of parameter dicts

Example: entities = connector.list_entities() for entity in entities: print(f"{entity['entity_name']}: {entity['available_actions']}")

read_skill_docs(self, section: str | None = None) ‑> str : Read this connector's usage docs, rendered to text.

Omit section for the outline and general guidance; pass an exact section id from the outline for full details. For local/offline connectors the full generated docs are returned and section is ignored.

Example: outline = await connector.read_skill_docs() details = await connector.read_skill_docs(section="entity:contacts")

LocationsQuery(connector: GoogleAnalyticsDataApiConnector) : Query class for Locations entity operations.

Initialize query with connector reference.

Methods​

context_store_search(self, query: LocationsSearchQuery, limit: int | None = None, cursor: str | None = None, fields: list[list[str]] | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[LocationsSearchData] : Search locations records from Airbyte cache.

This operation searches cached data from Airbyte syncs. Only available in hosted execution mode.

Available filter fields (LocationsSearchFilter):

  • average_session_duration: Average duration of sessions in seconds
  • bounce_rate: Percentage of sessions that were single-page with no interaction
  • city: The city of the user
  • country: The country of the user
  • date: Date of the report row in YYYYMMDD format
  • end_date: End date of the reporting period
  • new_users: Number of first-time users
  • property_id: GA4 property ID
  • region: The region (state/province) of the user
  • screen_page_views: Total number of screen or page views
  • screen_page_views_per_session: Average page views per session
  • sessions: Total number of sessions
  • sessions_per_user: Average number of sessions per user
  • start_date: Start date of the reporting period
  • total_users: Total number of unique users

Args: query: Filter and sort conditions. Supports operators such as eq, neq, gt, gte, lt, lte, in, startswith, endswith, contains, array_contains, fuzzy, keyword, not, and, or. Example: {"filter": {"eq": {"status": "active"}}} limit: Maximum results to return (default 1000) cursor: Pagination cursor from previous response's meta.cursor fields: Field paths to include in results. Each path is a list of keys for nested access. Example: [["id"], ["user", "name"]] returns id and user.name fields.

Returns: LocationsSearchResult with typed records, pagination metadata, and optional search metadata

Raises: NotImplementedError: If called in local execution mode

context_store_sql_query(self, sql: str, limit: int | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[dict[str, Any]] : Run a SQL query against locations records in the Airbyte Context Store.

Only available in hosted execution mode.

Args: sql: SQL query to execute. limit: Maximum results to return.

Returns: AirbyteSearchResult containing the projected rows and query metadata.

Raises: NotImplementedError: If called in local execution mode.

list(self, property_id: str, date_ranges: list[LocationsListParamsDaterangesItem] | None = None, dimensions: list[LocationsListParamsDimensionsItem] | None = None, metrics: list[LocationsListParamsMetricsItem] | None = None, keep_empty_rows: bool | None = None, return_property_quota: bool | None = None, limit: int | None = None, **kwargs) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiExecuteResultWithMeta[list[Row], LocationsListResultMeta] : Returns geographic metrics broken down by region, country, city, and date, including users, sessions, bounce rate, and page views.

Args: date_ranges: Date ranges of data to read, in YYYY-MM-DD or relative format (e.g., 30daysAgo, today). Defaults to the last 30 days. dimensions: GA4 dimensions to group results by. Defaults match the equivalent Data Replication report. metrics: GA4 metrics to aggregate. Defaults match the equivalent Data Replication report. keep_empty_rows: If false, rows whose metrics are all zero are omitted from the response. return_property_quota: Whether to include the Analytics property's current quota state in the response. limit: Maximum number of rows to return (the GA4 API caps a single request at 250,000 rows). property_id: GA4 property ID **kwargs: Additional parameters

Returns: LocationsListResult

PagesQuery(connector: GoogleAnalyticsDataApiConnector) : Query class for Pages entity operations.

Initialize query with connector reference.

Methods​

context_store_search(self, query: PagesSearchQuery, limit: int | None = None, cursor: str | None = None, fields: list[list[str]] | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[PagesSearchData] : Search pages records from Airbyte cache.

This operation searches cached data from Airbyte syncs. Only available in hosted execution mode.

Available filter fields (PagesSearchFilter):

  • bounce_rate: Percentage of sessions that were single-page with no interaction
  • date: Date of the report row in YYYYMMDD format
  • end_date: End date of the reporting period
  • host_name: The hostname of the page
  • page_path_plus_query_string: The page path and query string
  • property_id: GA4 property ID
  • screen_page_views: Total number of screen or page views
  • start_date: Start date of the reporting period

Args: query: Filter and sort conditions. Supports operators such as eq, neq, gt, gte, lt, lte, in, startswith, endswith, contains, array_contains, fuzzy, keyword, not, and, or. Example: {"filter": {"eq": {"status": "active"}}} limit: Maximum results to return (default 1000) cursor: Pagination cursor from previous response's meta.cursor fields: Field paths to include in results. Each path is a list of keys for nested access. Example: [["id"], ["user", "name"]] returns id and user.name fields.

Returns: PagesSearchResult with typed records, pagination metadata, and optional search metadata

Raises: NotImplementedError: If called in local execution mode

context_store_sql_query(self, sql: str, limit: int | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[dict[str, Any]] : Run a SQL query against pages records in the Airbyte Context Store.

Only available in hosted execution mode.

Args: sql: SQL query to execute. limit: Maximum results to return.

Returns: AirbyteSearchResult containing the projected rows and query metadata.

Raises: NotImplementedError: If called in local execution mode.

list(self, property_id: str, date_ranges: list[PagesListParamsDaterangesItem] | None = None, dimensions: list[PagesListParamsDimensionsItem] | None = None, metrics: list[PagesListParamsMetricsItem] | None = None, keep_empty_rows: bool | None = None, return_property_quota: bool | None = None, limit: int | None = None, **kwargs) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiExecuteResultWithMeta[list[Row], PagesListResultMeta] : Returns page-level metrics including page views and bounce rate, broken down by host name, page path, and date.

Args: date_ranges: Date ranges of data to read, in YYYY-MM-DD or relative format (e.g., 30daysAgo, today). Defaults to the last 30 days. dimensions: GA4 dimensions to group results by. Defaults match the equivalent Data Replication report. metrics: GA4 metrics to aggregate. Defaults match the equivalent Data Replication report. keep_empty_rows: If false, rows whose metrics are all zero are omitted from the response. return_property_quota: Whether to include the Analytics property's current quota state in the response. limit: Maximum number of rows to return (the GA4 API caps a single request at 250,000 rows). property_id: GA4 property ID **kwargs: Additional parameters

Returns: PagesListResult

TrafficSourcesQuery(connector: GoogleAnalyticsDataApiConnector) : Query class for TrafficSources entity operations.

Initialize query with connector reference.

Methods​

context_store_search(self, query: TrafficSourcesSearchQuery, limit: int | None = None, cursor: str | None = None, fields: list[list[str]] | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[TrafficSourcesSearchData] : Search traffic_sources records from Airbyte cache.

This operation searches cached data from Airbyte syncs. Only available in hosted execution mode.

Available filter fields (TrafficSourcesSearchFilter):

  • average_session_duration: Average duration of sessions in seconds
  • bounce_rate: Percentage of sessions that were single-page with no interaction
  • date: Date of the report row in YYYYMMDD format
  • end_date: End date of the reporting period
  • new_users: Number of first-time users
  • property_id: GA4 property ID
  • screen_page_views: Total number of screen or page views
  • screen_page_views_per_session: Average page views per session
  • session_medium: The medium of the traffic source (e.g., organic, cpc, referral)
  • session_source: The source of the traffic (e.g., google, direct)
  • sessions: Total number of sessions
  • sessions_per_user: Average number of sessions per user
  • start_date: Start date of the reporting period
  • total_users: Total number of unique users

Args: query: Filter and sort conditions. Supports operators such as eq, neq, gt, gte, lt, lte, in, startswith, endswith, contains, array_contains, fuzzy, keyword, not, and, or. Example: {"filter": {"eq": {"status": "active"}}} limit: Maximum results to return (default 1000) cursor: Pagination cursor from previous response's meta.cursor fields: Field paths to include in results. Each path is a list of keys for nested access. Example: [["id"], ["user", "name"]] returns id and user.name fields.

Returns: TrafficSourcesSearchResult with typed records, pagination metadata, and optional search metadata

Raises: NotImplementedError: If called in local execution mode

context_store_sql_query(self, sql: str, limit: int | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[dict[str, Any]] : Run a SQL query against traffic_sources records in the Airbyte Context Store.

Only available in hosted execution mode.

Args: sql: SQL query to execute. limit: Maximum results to return.

Returns: AirbyteSearchResult containing the projected rows and query metadata.

Raises: NotImplementedError: If called in local execution mode.

list(self, property_id: str, date_ranges: list[TrafficSourcesListParamsDaterangesItem] | None = None, dimensions: list[TrafficSourcesListParamsDimensionsItem] | None = None, metrics: list[TrafficSourcesListParamsMetricsItem] | None = None, keep_empty_rows: bool | None = None, return_property_quota: bool | None = None, limit: int | None = None, **kwargs) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiExecuteResultWithMeta[list[Row], TrafficSourcesListResultMeta] : Returns traffic source metrics broken down by session source, session medium, and date, including users, sessions, bounce rate, and page views.

Args: date_ranges: Date ranges of data to read, in YYYY-MM-DD or relative format (e.g., 30daysAgo, today). Defaults to the last 30 days. dimensions: GA4 dimensions to group results by. Defaults match the equivalent Data Replication report. metrics: GA4 metrics to aggregate. Defaults match the equivalent Data Replication report. keep_empty_rows: If false, rows whose metrics are all zero are omitted from the response. return_property_quota: Whether to include the Analytics property's current quota state in the response. limit: Maximum number of rows to return (the GA4 API caps a single request at 250,000 rows). property_id: GA4 property ID **kwargs: Additional parameters

Returns: TrafficSourcesListResult

WebsiteOverviewQuery(connector: GoogleAnalyticsDataApiConnector) : Query class for WebsiteOverview entity operations.

Initialize query with connector reference.

Methods​

context_store_search(self, query: WebsiteOverviewSearchQuery, limit: int | None = None, cursor: str | None = None, fields: list[list[str]] | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[WebsiteOverviewSearchData] : Search website_overview records from Airbyte cache.

This operation searches cached data from Airbyte syncs. Only available in hosted execution mode.

Available filter fields (WebsiteOverviewSearchFilter):

  • average_session_duration: Average duration of sessions in seconds
  • bounce_rate: Percentage of sessions that were single-page with no interaction
  • date: Date of the report row in YYYYMMDD format
  • end_date: End date of the reporting period
  • new_users: Number of first-time users
  • property_id: GA4 property ID
  • screen_page_views: Total number of screen or page views
  • screen_page_views_per_session: Average page views per session
  • sessions: Total number of sessions
  • sessions_per_user: Average number of sessions per user
  • start_date: Start date of the reporting period
  • total_users: Total number of unique users

Args: query: Filter and sort conditions. Supports operators such as eq, neq, gt, gte, lt, lte, in, startswith, endswith, contains, array_contains, fuzzy, keyword, not, and, or. Example: {"filter": {"eq": {"status": "active"}}} limit: Maximum results to return (default 1000) cursor: Pagination cursor from previous response's meta.cursor fields: Field paths to include in results. Each path is a list of keys for nested access. Example: [["id"], ["user", "name"]] returns id and user.name fields.

Returns: WebsiteOverviewSearchResult with typed records, pagination metadata, and optional search metadata

Raises: NotImplementedError: If called in local execution mode

context_store_sql_query(self, sql: str, limit: int | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[dict[str, Any]] : Run a SQL query against website_overview records in the Airbyte Context Store.

Only available in hosted execution mode.

Args: sql: SQL query to execute. limit: Maximum results to return.

Returns: AirbyteSearchResult containing the projected rows and query metadata.

Raises: NotImplementedError: If called in local execution mode.

list(self, property_id: str, date_ranges: list[WebsiteOverviewListParamsDaterangesItem] | None = None, dimensions: list[WebsiteOverviewListParamsDimensionsItem] | None = None, metrics: list[WebsiteOverviewListParamsMetricsItem] | None = None, keep_empty_rows: bool | None = None, return_property_quota: bool | None = None, limit: int | None = None, **kwargs) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiExecuteResultWithMeta[list[Row], WebsiteOverviewListResultMeta] : Returns website overview metrics including total users, new users, sessions, bounce rate, page views, and average session duration by date.

Args: date_ranges: Date ranges of data to read, in YYYY-MM-DD or relative format (e.g., 30daysAgo, today). Defaults to the last 30 days. dimensions: GA4 dimensions to group results by. Defaults match the equivalent Data Replication report. metrics: GA4 metrics to aggregate. Defaults match the equivalent Data Replication report. keep_empty_rows: If false, rows whose metrics are all zero are omitted from the response. return_property_quota: Whether to include the Analytics property's current quota state in the response. limit: Maximum number of rows to return (the GA4 API caps a single request at 250,000 rows). property_id: GA4 property ID **kwargs: Additional parameters

Returns: WebsiteOverviewListResult

WeeklyActiveUsersQuery(connector: GoogleAnalyticsDataApiConnector) : Query class for WeeklyActiveUsers entity operations.

Initialize query with connector reference.

Methods​

context_store_search(self, query: WeeklyActiveUsersSearchQuery, limit: int | None = None, cursor: str | None = None, fields: list[list[str]] | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[WeeklyActiveUsersSearchData] : Search weekly_active_users records from Airbyte cache.

This operation searches cached data from Airbyte syncs. Only available in hosted execution mode.

Available filter fields (WeeklyActiveUsersSearchFilter):

  • active7_day_users: Number of distinct users active in the last 7 days
  • date: Date of the report row in YYYYMMDD format
  • end_date: End date of the reporting period
  • property_id: GA4 property ID
  • start_date: Start date of the reporting period

Args: query: Filter and sort conditions. Supports operators such as eq, neq, gt, gte, lt, lte, in, startswith, endswith, contains, array_contains, fuzzy, keyword, not, and, or. Example: {"filter": {"eq": {"status": "active"}}} limit: Maximum results to return (default 1000) cursor: Pagination cursor from previous response's meta.cursor fields: Field paths to include in results. Each path is a list of keys for nested access. Example: [["id"], ["user", "name"]] returns id and user.name fields.

Returns: WeeklyActiveUsersSearchResult with typed records, pagination metadata, and optional search metadata

Raises: NotImplementedError: If called in local execution mode

context_store_sql_query(self, sql: str, limit: int | None = None) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.AirbyteSearchResult[dict[str, Any]] : Run a SQL query against weekly_active_users records in the Airbyte Context Store.

Only available in hosted execution mode.

Args: sql: SQL query to execute. limit: Maximum results to return.

Returns: AirbyteSearchResult containing the projected rows and query metadata.

Raises: NotImplementedError: If called in local execution mode.

list(self, property_id: str, date_ranges: list[WeeklyActiveUsersListParamsDaterangesItem] | None = None, dimensions: list[WeeklyActiveUsersListParamsDimensionsItem] | None = None, metrics: list[WeeklyActiveUsersListParamsMetricsItem] | None = None, keep_empty_rows: bool | None = None, return_property_quota: bool | None = None, limit: int | None = None, **kwargs) ‑> airbyte_agent_sdk.connectors.google_analytics_data_api.models.GoogleAnalyticsDataApiExecuteResultWithMeta[list[Row], WeeklyActiveUsersListResultMeta] : Returns weekly active user counts (7-day active users) by date.

Args: date_ranges: Date ranges of data to read, in YYYY-MM-DD or relative format (e.g., 30daysAgo, today). Defaults to the last 30 days. dimensions: GA4 dimensions to group results by. Defaults match the equivalent Data Replication report. metrics: GA4 metrics to aggregate. Defaults match the equivalent Data Replication report. keep_empty_rows: If false, rows whose metrics are all zero are omitted from the response. return_property_quota: Whether to include the Analytics property's current quota state in the response. limit: Maximum number of rows to return (the GA4 API caps a single request at 250,000 rows). property_id: GA4 property ID **kwargs: Additional parameters

Returns: WeeklyActiveUsersListResult