airflow.providers.google.marketing_platform.hooks.analytics_admin¶
Hooks for Google Analytics (GA4) Admin service.
Classes¶
| Hook for Google Analytics 4 (GA4) Admin API. | 
Module Contents¶
- class airflow.providers.google.marketing_platform.hooks.analytics_admin.GoogleAnalyticsAdminHook(*args, **kwargs)[source]¶
- Bases: - airflow.providers.google.common.hooks.base_google.GoogleBaseHook- Hook for Google Analytics 4 (GA4) Admin API. - list_accounts(page_size=None, page_token=None, show_deleted=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
- Get list of accounts in Google Analytics. - See also - For more details please check the client library documentation: https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/accounts/list - Parameters:
- page_size (int | None) – Optional, number of results to return in the list. 
- page_token (str | None) – Optional. The next_page_token value returned from a previous List request, if any. 
- show_deleted (bool | None) – Optional. Whether to include soft-deleted (ie: “trashed”) Accounts in the results. 
- retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional, a retry object used to retry requests. If None is specified, requests will not be retried. 
- timeout (float | None) – Optional. The timeout for this request. 
- metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata. 
 
- Returns:
- List of Google Analytics accounts. 
- Return type:
- google.analytics.admin_v1beta.services.analytics_admin_service.pagers.ListAccountsPager 
 
 - create_property(analytics_property, retry=DEFAULT, timeout=None, metadata=())[source]¶
- Create Google Analytics property. - See also - For more details please check the client library documentation: https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties/create - Parameters:
- analytics_property (google.analytics.admin_v1beta.Property | dict) – The property to create. Note: the supplied property must specify its parent. 
- retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional, a retry object used to retry requests. If None is specified, requests will not be retried. 
- timeout (float | None) – Optional. The timeout for this request. 
- metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata. 
 
- Returns:
- Created Google Analytics property. 
- Return type:
- google.analytics.admin_v1beta.Property 
 
 - delete_property(property_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
- Soft delete Google Analytics property. - See also - For more details please check the client library documentation: https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties/delete - Parameters:
- property_id (str) – ID of the Property to soft-delete. Format: properties/{property_id}. 
- retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional, a retry object used to retry requests. If None is specified, requests will not be retried. 
- timeout (float | None) – Optional. The timeout for this request. 
- metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata. 
 
- Returns:
- Resource message representing Google Analytics property. 
- Return type:
- google.analytics.admin_v1beta.Property 
 
 - create_data_stream(property_id, data_stream, retry=DEFAULT, timeout=None, metadata=())[source]¶
- Create Google Analytics data stream. - See also - For more details please check the client library documentation: https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties.dataStreams/create - Parameters:
- property_id (str) – ID of the parent property for the data stream. 
- data_stream (google.analytics.admin_v1beta.DataStream | dict) – The data stream to create. 
- retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional, a retry object used to retry requests. If None is specified, requests will not be retried. 
- timeout (float | None) – Optional. The timeout for this request. 
- metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata. 
 
- Returns:
- Created Google Analytics data stream. 
- Return type:
- google.analytics.admin_v1beta.DataStream 
 
 - delete_data_stream(property_id, data_stream_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
- Delete Google Analytics data stream. - See also - For more details please check the client library documentation: https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties.dataStreams/delete - Parameters:
- property_id (str) – ID of the parent property for the data stream. 
- data_stream_id (str) – The data stream id to delete. 
- retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional, a retry object used to retry requests. If None is specified, requests will not be retried. 
- timeout (float | None) – Optional. The timeout for this request. 
- metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata. 
 
 
 - list_google_ads_links(property_id, page_size=None, page_token=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
- Get list of Google Ads links. - See also - For more details please check the client library documentation: https://googleapis.dev/python/analyticsadmin/latest/admin_v1beta/analytics_admin_service.html#google.analytics.admin_v1beta.services.analytics_admin_service.AnalyticsAdminServiceAsyncClient.list_google_ads_links - Parameters:
- property_id (str) – ID of the parent property. 
- page_size (int | None) – Optional, number of results to return in the list. 
- page_token (str | None) – Optional. The next_page_token value returned from a previous List request, if any. 
- retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional, a retry object used to retry requests. If None is specified, requests will not be retried. 
- timeout (float | None) – Optional. The timeout for this request. 
- metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata. 
 
- Returns:
- List of Google Analytics accounts. 
- Return type:
- google.analytics.admin_v1beta.services.analytics_admin_service.pagers.ListGoogleAdsLinksPager