airflow.providers.google.marketing_platform.operators.analytics_admin

This module contains Google Analytics 4 (GA4) operators.

Module Contents

Classes

GoogleAnalyticsAdminListAccountsOperator

Lists all accounts to which the user has access.

GoogleAnalyticsAdminCreatePropertyOperator

Creates property.

GoogleAnalyticsAdminDeletePropertyOperator

Soft-delete property.

GoogleAnalyticsAdminCreateDataStreamOperator

Creates Data stream.

GoogleAnalyticsAdminDeleteDataStreamOperator

Deletes Data stream.

GoogleAnalyticsAdminListGoogleAdsLinksOperator

Lists all Google Ads links associated with a given property.

GoogleAnalyticsAdminGetGoogleAdsLinkOperator

Gets a Google Ads link associated with a given property.

class airflow.providers.google.marketing_platform.operators.analytics_admin.GoogleAnalyticsAdminListAccountsOperator(*, page_size=None, page_token=None, show_deleted=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Lists all accounts to which the user has access.

See also

For more information on how to use this operator, take a look at the guide: List the Accounts

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 (Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional. Service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: Sequence[str] = ('gcp_conn_id', 'impersonation_chain', 'page_size', 'page_token')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.analytics_admin.GoogleAnalyticsAdminCreatePropertyOperator(*, analytics_property, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Creates property.

See also

For more information on how to use this operator, take a look at the guide: Create Property

Parameters
  • analytics_property (google.analytics.admin_v1beta.Property | dict[str, Any]) – The property to create. Note: the supplied property must specify its parent. For more details see: https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties#Property

  • 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 (Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional. Service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: Sequence[str] = ('gcp_conn_id', 'impersonation_chain', 'analytics_property')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.analytics_admin.GoogleAnalyticsAdminDeletePropertyOperator(*, property_id, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Soft-delete property.

See also

For more information on how to use this operator, take a look at the guide: Delete Property

Parameters
  • property_id (str) – The id of the Property to soft-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 (Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional. Service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: Sequence[str] = ('gcp_conn_id', 'impersonation_chain', 'property_id')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.analytics_admin.GoogleAnalyticsAdminCreateDataStreamOperator(*, property_id, data_stream, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Creates Data stream.

See also

For more information on how to use this operator, take a look at the guide: Create Data stream

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. For more details see: https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties.dataStreams#DataStream

  • 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 (Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional. Service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: Sequence[str] = ('gcp_conn_id', 'impersonation_chain', 'property_id', 'data_stream')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.analytics_admin.GoogleAnalyticsAdminDeleteDataStreamOperator(*, property_id, data_stream_id, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Deletes Data stream.

See also

For more information on how to use this operator, take a look at the guide: Delete Data stream

Parameters
  • property_id (str) – ID of the property which is parent for the data stream.

  • data_stream_id (str) – ID of the data stream 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 (Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional. Service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: Sequence[str] = ('gcp_conn_id', 'impersonation_chain', 'property_id', 'data_stream_id')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.analytics_admin.GoogleAnalyticsAdminListGoogleAdsLinksOperator(*, property_id, page_size=None, page_token=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Lists all Google Ads links associated with a given property.

See also

For more information on how to use this operator, take a look at the guide: 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 (Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional. Service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: Sequence[str] = ('gcp_conn_id', 'impersonation_chain', 'property_id', 'page_size', 'page_token')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.marketing_platform.operators.analytics_admin.GoogleAnalyticsAdminGetGoogleAdsLinkOperator(*, property_id, google_ads_link_id, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Gets a Google Ads link associated with a given property.

See also

For more information on how to use this operator, take a look at the guide: Get the Google Ads link

Parameters
  • property_id (str) – Parent property id.

  • google_ads_link_id (str) – Google Ads link 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 (Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • impersonation_chain (str | Sequence[str] | None) – Optional. Service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: Sequence[str] = ('gcp_conn_id', 'impersonation_chain', 'google_ads_link_id')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?