As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

AlphaAnalyticsData

class google.analytics.data_v1alpha.services.alpha_analytics_data.AlphaAnalyticsDataAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Union[str, google.analytics.data_v1alpha.services.alpha_analytics_data.transports.base.AlphaAnalyticsDataTransport] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]

Google Analytics reporting data service.

Instantiates the alpha analytics data async client.

Parameters
  • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

  • transport (Union[str, AlphaAnalyticsDataTransport]) – The transport to use. If set to None, a transport is chosen automatically.

  • client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]) –

    Custom options for the client.

    1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: “always” (always use the default mTLS endpoint), “never” (always use the default regular endpoint) and “auto” (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value).

    2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is “false” or not set, no client certificate will be used.

    3. The universe_domain property can be used to override the default “googleapis.com” universe. Note that api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

  • client_info (google.api_core.gapic_v1.client_info.ClientInfo) – The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you’re developing your own client library.

Raises

google.auth.exceptions.MutualTlsChannelError – If mutual TLS transport creation failed for any reason.

property api_endpoint

Return the API endpoint used by the client instance.

Returns

The API endpoint used by the client instance.

Return type

str

static audience_list_path(property: str, audience_list: str) str

Returns a fully-qualified audience_list string.

static common_billing_account_path(billing_account: str) str

Returns a fully-qualified billing_account string.

static common_folder_path(folder: str) str

Returns a fully-qualified folder string.

static common_location_path(project: str, location: str) str

Returns a fully-qualified location string.

static common_organization_path(organization: str) str

Returns a fully-qualified organization string.

static common_project_path(project: str) str

Returns a fully-qualified project string.

async create_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.CreateAudienceListRequest, dict]] = None, *, parent: Optional[str] = None, audience_list: Optional[google.analytics.data_v1alpha.types.analytics_data_api.AudienceList] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.api_core.operation_async.AsyncOperation[source]

Creates an audience list for later retrieval. This method quickly returns the audience list’s resource name and initiates a long running asynchronous request to form an audience list. To list the users in an audience list, first create the audience list through this method and then send the audience resource name to the QueryAudienceList method.

See Creating an Audience List for an introduction to Audience Lists with examples.

An audience list is a snapshot of the users currently in the audience at the time of audience list creation. Creating audience lists for one audience on different days will return different results as users enter and exit the audience.

Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572. Audience lists contain the users in each audience.

This method is available at beta stability at audienceExports.create. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_create_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    audience_list = data_v1alpha.AudienceList()
    audience_list.audience = "audience_value"

    request = data_v1alpha.CreateAudienceListRequest(
        parent="parent_value",
        audience_list=audience_list,
    )

    # Make the request
    operation = client.create_audience_list(request=request)

    print("Waiting for operation to complete...")

    response = (await operation).result()

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.CreateAudienceListRequest, dict]]) – The request object. A request to create a new audience list.

  • parent (str) –

    Required. The parent resource where this audience list will be created. Format: properties/{property}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • audience_list (google.analytics.data_v1alpha.types.AudienceList) –

    Required. The audience list to create.

    This corresponds to the audience_list field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

An object representing a long-running operation.

The result type for the operation will be google.analytics.data_v1alpha.types.AudienceList An audience list is a list of users in an audience at the time of the list’s

creation. One audience may have multiple audience lists created for different days.

Return type

google.api_core.operation_async.AsyncOperation

async create_recurring_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.CreateRecurringAudienceListRequest, dict]] = None, *, parent: Optional[str] = None, recurring_audience_list: Optional[google.analytics.data_v1alpha.types.analytics_data_api.RecurringAudienceList] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.RecurringAudienceList[source]

Creates a recurring audience list. Recurring audience lists produces new audience lists each day. Audience lists are users in an audience at the time of the list’s creation.

A recurring audience list ensures that you have audience list based on the most recent data available for use each day. If you manually create audience list, you don’t know when an audience list based on an additional day’s data is available. This recurring audience list automates the creation of an audience list when an additional day’s data is available. You will consume fewer quota tokens by using recurring audience list versus manually creating audience list at various times of day trying to guess when an additional day’s data is ready.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_create_recurring_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    recurring_audience_list = data_v1alpha.RecurringAudienceList()
    recurring_audience_list.audience = "audience_value"

    request = data_v1alpha.CreateRecurringAudienceListRequest(
        parent="parent_value",
        recurring_audience_list=recurring_audience_list,
    )

    # Make the request
    response = await client.create_recurring_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.CreateRecurringAudienceListRequest, dict]]) – The request object. A request to create a new recurring audience list.

  • parent (str) –

    Required. The parent resource where this recurring audience list will be created. Format: properties/{property}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • recurring_audience_list (google.analytics.data_v1alpha.types.RecurringAudienceList) –

    Required. The recurring audience list to create.

    This corresponds to the recurring_audience_list field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A recurring audience list produces new audience lists each day. Audience lists are users in an audience at the time of the list’s creation. A recurring audience list ensures that you have audience list based on the most recent data available for use each day.

Return type

google.analytics.data_v1alpha.types.RecurringAudienceList

classmethod from_service_account_file(filename: str, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

AlphaAnalyticsDataAsyncClient

classmethod from_service_account_info(info: dict, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

info.

Parameters
  • info (dict) – The service account private key info.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

AlphaAnalyticsDataAsyncClient

classmethod from_service_account_json(filename: str, *args, **kwargs)
Creates an instance of this client using the provided credentials

file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

AlphaAnalyticsDataAsyncClient

async get_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.GetAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.AudienceList[source]

Gets configuration metadata about a specific audience list. This method can be used to understand an audience list after it has been created.

See Creating an Audience List for an introduction to Audience Lists with examples.

This method is available at beta stability at audienceExports.get. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_get_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    request = data_v1alpha.GetAudienceListRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.GetAudienceListRequest, dict]]) – The request object. A request to retrieve configuration metadata about a specific audience list.

  • name (str) –

    Required. The audience list resource name. Format: properties/{property}/audienceLists/{audience_list}

    This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

An audience list is a list of users in an audience at the time of the list’s creation. One audience may have multiple audience lists created for different days.

Return type

google.analytics.data_v1alpha.types.AudienceList

classmethod get_mtls_endpoint_and_cert_source(client_options: Optional[google.api_core.client_options.ClientOptions] = None)[source]

Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not “true”, the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “always”, use the default mTLS endpoint; if the environment variable is “never”, use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameters

client_options (google.api_core.client_options.ClientOptions) – Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Returns

returns the API endpoint and the

client cert source to use.

Return type

Tuple[str, Callable[[], Tuple[bytes, bytes]]]

Raises

google.auth.exceptions.MutualTLSChannelError – If any errors happen.

async get_recurring_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.GetRecurringAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.RecurringAudienceList[source]

Gets configuration metadata about a specific recurring audience list. This method can be used to understand a recurring audience list’s state after it has been created. For example, a recurring audience list resource will generate audience list instances for each day, and this method can be used to get the resource name of the most recent audience list instance.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_get_recurring_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    request = data_v1alpha.GetRecurringAudienceListRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_recurring_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.GetRecurringAudienceListRequest, dict]]) – The request object. A request to retrieve configuration metadata about a specific recurring audience list.

  • name (str) –

    Required. The recurring audience list resource name. Format: properties/{property}/recurringAudienceLists/{recurring_audience_list}

    This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A recurring audience list produces new audience lists each day. Audience lists are users in an audience at the time of the list’s creation. A recurring audience list ensures that you have audience list based on the most recent data available for use each day.

Return type

google.analytics.data_v1alpha.types.RecurringAudienceList

get_transport_class() Type[google.analytics.data_v1alpha.services.alpha_analytics_data.transports.base.AlphaAnalyticsDataTransport]

Returns an appropriate transport class.

Parameters

label – The name of the desired transport. If none is provided, then the first transport in the registry is used.

Returns

The transport class to use.

async list_audience_lists(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListAudienceListsAsyncPager[source]

Lists all audience lists for a property. This method can be used for you to find and reuse existing audience lists rather than creating unnecessary new audience lists. The same audience can have multiple audience lists that represent the list of users that were in an audience on different days.

See Creating an Audience List for an introduction to Audience Lists with examples.

This method is available at beta stability at audienceExports.list. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_list_audience_lists():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    request = data_v1alpha.ListAudienceListsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_audience_lists(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.ListAudienceListsRequest, dict]]) – The request object. A request to list all audience lists for a property.

  • parent (str) –

    Required. All audience lists for this property will be listed in the response. Format: properties/{property}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A list of all audience lists for a property. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListAudienceListsAsyncPager

async list_recurring_audience_lists(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.ListRecurringAudienceListsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListRecurringAudienceListsAsyncPager[source]

Lists all recurring audience lists for a property. This method can be used for you to find and reuse existing recurring audience lists rather than creating unnecessary new recurring audience lists. The same audience can have multiple recurring audience lists that represent different dimension combinations; for example, just the dimension deviceId or both the dimensions deviceId and userId.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_list_recurring_audience_lists():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    request = data_v1alpha.ListRecurringAudienceListsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_recurring_audience_lists(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.ListRecurringAudienceListsRequest, dict]]) – The request object. A request to list all recurring audience lists for a property.

  • parent (str) –

    Required. All recurring audience lists for this property will be listed in the response. Format: properties/{property}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A list of all recurring audience lists for a property. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListRecurringAudienceListsAsyncPager

static parse_audience_list_path(path: str) Dict[str, str]

Parses a audience_list path into its component segments.

static parse_common_billing_account_path(path: str) Dict[str, str]

Parse a billing_account path into its component segments.

static parse_common_folder_path(path: str) Dict[str, str]

Parse a folder path into its component segments.

static parse_common_location_path(path: str) Dict[str, str]

Parse a location path into its component segments.

static parse_common_organization_path(path: str) Dict[str, str]

Parse a organization path into its component segments.

static parse_common_project_path(path: str) Dict[str, str]

Parse a project path into its component segments.

static parse_recurring_audience_list_path(path: str) Dict[str, str]

Parses a recurring_audience_list path into its component segments.

async query_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.QueryAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.QueryAudienceListResponse[source]

Retrieves an audience list of users. After creating an audience, the users are not immediately available for listing. First, a request to CreateAudienceList is necessary to create an audience list of users, and then second, this method is used to retrieve the users in the audience list.

See Creating an Audience List for an introduction to Audience Lists with examples.

Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572.

This method is available at beta stability at audienceExports.query. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_query_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    request = data_v1alpha.QueryAudienceListRequest(
        name="name_value",
    )

    # Make the request
    response = await client.query_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.QueryAudienceListRequest, dict]]) – The request object. A request to list users in an audience list.

  • name (str) –

    Required. The name of the audience list to retrieve users from. Format: properties/{property}/audienceLists/{audience_list}

    This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A list of users in an audience list.

Return type

google.analytics.data_v1alpha.types.QueryAudienceListResponse

static recurring_audience_list_path(property: str, recurring_audience_list: str) str

Returns a fully-qualified recurring_audience_list string.

async run_funnel_report(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.RunFunnelReportRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.RunFunnelReportResponse[source]

Returns a customized funnel report of your Google Analytics event data. The data returned from the API is as a table with columns for the requested dimensions and metrics.

Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step. For example, how do prospects become shoppers and then become buyers? How do one time buyers become repeat buyers? With this information, you can improve inefficient or abandoned customer journeys. To learn more, see GA4 Funnel Explorations.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Data API Funnel Reporting Feedback.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_run_funnel_report():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    request = data_v1alpha.RunFunnelReportRequest(
    )

    # Make the request
    response = await client.run_funnel_report(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.RunFunnelReportRequest, dict]]) – The request object. The request for a funnel report.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The funnel report response contains two sub reports. The two sub reports are different combinations of dimensions and metrics.

Return type

google.analytics.data_v1alpha.types.RunFunnelReportResponse

async sheet_export_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.SheetExportAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.SheetExportAudienceListResponse[source]

Exports an audience list of users to a Google Sheet. After creating an audience, the users are not immediately available for listing. First, a request to CreateAudienceList is necessary to create an audience list of users, and then second, this method is used to export those users in the audience list to a Google Sheet.

See Creating an Audience List for an introduction to Audience Lists with examples.

Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

async def sample_sheet_export_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataAsyncClient()

    # Initialize request argument(s)
    request = data_v1alpha.SheetExportAudienceListRequest(
        name="name_value",
    )

    # Make the request
    response = await client.sheet_export_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.analytics.data_v1alpha.types.SheetExportAudienceListRequest, dict]]) – The request object. A request to export users in an audience list to a Google Sheet.

  • name (str) –

    Required. The name of the audience list to retrieve users from. Format: properties/{property}/audienceLists/{audience_list}

    This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry_async.AsyncRetry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The created Google Sheet with the list of users in an audience list.

Return type

google.analytics.data_v1alpha.types.SheetExportAudienceListResponse

property transport: google.analytics.data_v1alpha.services.alpha_analytics_data.transports.base.AlphaAnalyticsDataTransport

Returns the transport used by the client instance.

Returns

The transport used by the client instance.

Return type

AlphaAnalyticsDataTransport

property universe_domain: str

Return the universe domain used by the client instance.

Returns

The universe domain used

by the client instance.

Return type

str

class google.analytics.data_v1alpha.services.alpha_analytics_data.AlphaAnalyticsDataClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.analytics.data_v1alpha.services.alpha_analytics_data.transports.base.AlphaAnalyticsDataTransport]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]

Google Analytics reporting data service.

Instantiates the alpha analytics data client.

Parameters
  • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

  • transport (Union[str, AlphaAnalyticsDataTransport]) – The transport to use. If set to None, a transport is chosen automatically.

  • client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]) –

    Custom options for the client.

    1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: “always” (always use the default mTLS endpoint), “never” (always use the default regular endpoint) and “auto” (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value).

    2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is “false” or not set, no client certificate will be used.

    3. The universe_domain property can be used to override the default “googleapis.com” universe. Note that the api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

  • client_info (google.api_core.gapic_v1.client_info.ClientInfo) – The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you’re developing your own client library.

Raises

google.auth.exceptions.MutualTLSChannelError – If mutual TLS transport creation failed for any reason.

__exit__(type, value, traceback)[source]

Releases underlying transport’s resources.

Warning

ONLY use as a context manager if the transport is NOT shared with other clients! Exiting the with block will CLOSE the transport and may cause errors in other clients!

property api_endpoint

Return the API endpoint used by the client instance.

Returns

The API endpoint used by the client instance.

Return type

str

static audience_list_path(property: str, audience_list: str) str[source]

Returns a fully-qualified audience_list string.

static common_billing_account_path(billing_account: str) str[source]

Returns a fully-qualified billing_account string.

static common_folder_path(folder: str) str[source]

Returns a fully-qualified folder string.

static common_location_path(project: str, location: str) str[source]

Returns a fully-qualified location string.

static common_organization_path(organization: str) str[source]

Returns a fully-qualified organization string.

static common_project_path(project: str) str[source]

Returns a fully-qualified project string.

create_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.CreateAudienceListRequest, dict]] = None, *, parent: Optional[str] = None, audience_list: Optional[google.analytics.data_v1alpha.types.analytics_data_api.AudienceList] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.api_core.operation.Operation[source]

Creates an audience list for later retrieval. This method quickly returns the audience list’s resource name and initiates a long running asynchronous request to form an audience list. To list the users in an audience list, first create the audience list through this method and then send the audience resource name to the QueryAudienceList method.

See Creating an Audience List for an introduction to Audience Lists with examples.

An audience list is a snapshot of the users currently in the audience at the time of audience list creation. Creating audience lists for one audience on different days will return different results as users enter and exit the audience.

Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572. Audience lists contain the users in each audience.

This method is available at beta stability at audienceExports.create. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_create_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    audience_list = data_v1alpha.AudienceList()
    audience_list.audience = "audience_value"

    request = data_v1alpha.CreateAudienceListRequest(
        parent="parent_value",
        audience_list=audience_list,
    )

    # Make the request
    operation = client.create_audience_list(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
  • request (Union[google.analytics.data_v1alpha.types.CreateAudienceListRequest, dict]) – The request object. A request to create a new audience list.

  • parent (str) –

    Required. The parent resource where this audience list will be created. Format: properties/{property}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • audience_list (google.analytics.data_v1alpha.types.AudienceList) –

    Required. The audience list to create.

    This corresponds to the audience_list field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

An object representing a long-running operation.

The result type for the operation will be google.analytics.data_v1alpha.types.AudienceList An audience list is a list of users in an audience at the time of the list’s

creation. One audience may have multiple audience lists created for different days.

Return type

google.api_core.operation.Operation

create_recurring_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.CreateRecurringAudienceListRequest, dict]] = None, *, parent: Optional[str] = None, recurring_audience_list: Optional[google.analytics.data_v1alpha.types.analytics_data_api.RecurringAudienceList] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.RecurringAudienceList[source]

Creates a recurring audience list. Recurring audience lists produces new audience lists each day. Audience lists are users in an audience at the time of the list’s creation.

A recurring audience list ensures that you have audience list based on the most recent data available for use each day. If you manually create audience list, you don’t know when an audience list based on an additional day’s data is available. This recurring audience list automates the creation of an audience list when an additional day’s data is available. You will consume fewer quota tokens by using recurring audience list versus manually creating audience list at various times of day trying to guess when an additional day’s data is ready.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_create_recurring_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    recurring_audience_list = data_v1alpha.RecurringAudienceList()
    recurring_audience_list.audience = "audience_value"

    request = data_v1alpha.CreateRecurringAudienceListRequest(
        parent="parent_value",
        recurring_audience_list=recurring_audience_list,
    )

    # Make the request
    response = client.create_recurring_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.analytics.data_v1alpha.types.CreateRecurringAudienceListRequest, dict]) – The request object. A request to create a new recurring audience list.

  • parent (str) –

    Required. The parent resource where this recurring audience list will be created. Format: properties/{property}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • recurring_audience_list (google.analytics.data_v1alpha.types.RecurringAudienceList) –

    Required. The recurring audience list to create.

    This corresponds to the recurring_audience_list field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A recurring audience list produces new audience lists each day. Audience lists are users in an audience at the time of the list’s creation. A recurring audience list ensures that you have audience list based on the most recent data available for use each day.

Return type

google.analytics.data_v1alpha.types.RecurringAudienceList

classmethod from_service_account_file(filename: str, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

AlphaAnalyticsDataClient

classmethod from_service_account_info(info: dict, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

info.

Parameters
  • info (dict) – The service account private key info.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

AlphaAnalyticsDataClient

classmethod from_service_account_json(filename: str, *args, **kwargs)
Creates an instance of this client using the provided credentials

file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

AlphaAnalyticsDataClient

get_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.GetAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.AudienceList[source]

Gets configuration metadata about a specific audience list. This method can be used to understand an audience list after it has been created.

See Creating an Audience List for an introduction to Audience Lists with examples.

This method is available at beta stability at audienceExports.get. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_get_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    request = data_v1alpha.GetAudienceListRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.analytics.data_v1alpha.types.GetAudienceListRequest, dict]) – The request object. A request to retrieve configuration metadata about a specific audience list.

  • name (str) –

    Required. The audience list resource name. Format: properties/{property}/audienceLists/{audience_list}

    This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

An audience list is a list of users in an audience at the time of the list’s creation. One audience may have multiple audience lists created for different days.

Return type

google.analytics.data_v1alpha.types.AudienceList

classmethod get_mtls_endpoint_and_cert_source(client_options: Optional[google.api_core.client_options.ClientOptions] = None)[source]

Deprecated. Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not “true”, the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “always”, use the default mTLS endpoint; if the environment variable is “never”, use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameters

client_options (google.api_core.client_options.ClientOptions) – Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Returns

returns the API endpoint and the

client cert source to use.

Return type

Tuple[str, Callable[[], Tuple[bytes, bytes]]]

Raises

google.auth.exceptions.MutualTLSChannelError – If any errors happen.

get_recurring_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.GetRecurringAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.RecurringAudienceList[source]

Gets configuration metadata about a specific recurring audience list. This method can be used to understand a recurring audience list’s state after it has been created. For example, a recurring audience list resource will generate audience list instances for each day, and this method can be used to get the resource name of the most recent audience list instance.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_get_recurring_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    request = data_v1alpha.GetRecurringAudienceListRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_recurring_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.analytics.data_v1alpha.types.GetRecurringAudienceListRequest, dict]) – The request object. A request to retrieve configuration metadata about a specific recurring audience list.

  • name (str) –

    Required. The recurring audience list resource name. Format: properties/{property}/recurringAudienceLists/{recurring_audience_list}

    This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A recurring audience list produces new audience lists each day. Audience lists are users in an audience at the time of the list’s creation. A recurring audience list ensures that you have audience list based on the most recent data available for use each day.

Return type

google.analytics.data_v1alpha.types.RecurringAudienceList

list_audience_lists(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListAudienceListsPager[source]

Lists all audience lists for a property. This method can be used for you to find and reuse existing audience lists rather than creating unnecessary new audience lists. The same audience can have multiple audience lists that represent the list of users that were in an audience on different days.

See Creating an Audience List for an introduction to Audience Lists with examples.

This method is available at beta stability at audienceExports.list. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_list_audience_lists():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    request = data_v1alpha.ListAudienceListsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_audience_lists(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.analytics.data_v1alpha.types.ListAudienceListsRequest, dict]) – The request object. A request to list all audience lists for a property.

  • parent (str) –

    Required. All audience lists for this property will be listed in the response. Format: properties/{property}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A list of all audience lists for a property. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListAudienceListsPager

list_recurring_audience_lists(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.ListRecurringAudienceListsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListRecurringAudienceListsPager[source]

Lists all recurring audience lists for a property. This method can be used for you to find and reuse existing recurring audience lists rather than creating unnecessary new recurring audience lists. The same audience can have multiple recurring audience lists that represent different dimension combinations; for example, just the dimension deviceId or both the dimensions deviceId and userId.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_list_recurring_audience_lists():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    request = data_v1alpha.ListRecurringAudienceListsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_recurring_audience_lists(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.analytics.data_v1alpha.types.ListRecurringAudienceListsRequest, dict]) – The request object. A request to list all recurring audience lists for a property.

  • parent (str) –

    Required. All recurring audience lists for this property will be listed in the response. Format: properties/{property}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A list of all recurring audience lists for a property. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListRecurringAudienceListsPager

static parse_audience_list_path(path: str) Dict[str, str][source]

Parses a audience_list path into its component segments.

static parse_common_billing_account_path(path: str) Dict[str, str][source]

Parse a billing_account path into its component segments.

static parse_common_folder_path(path: str) Dict[str, str][source]

Parse a folder path into its component segments.

static parse_common_location_path(path: str) Dict[str, str][source]

Parse a location path into its component segments.

static parse_common_organization_path(path: str) Dict[str, str][source]

Parse a organization path into its component segments.

static parse_common_project_path(path: str) Dict[str, str][source]

Parse a project path into its component segments.

static parse_recurring_audience_list_path(path: str) Dict[str, str][source]

Parses a recurring_audience_list path into its component segments.

query_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.QueryAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.QueryAudienceListResponse[source]

Retrieves an audience list of users. After creating an audience, the users are not immediately available for listing. First, a request to CreateAudienceList is necessary to create an audience list of users, and then second, this method is used to retrieve the users in the audience list.

See Creating an Audience List for an introduction to Audience Lists with examples.

Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572.

This method is available at beta stability at audienceExports.query. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_query_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    request = data_v1alpha.QueryAudienceListRequest(
        name="name_value",
    )

    # Make the request
    response = client.query_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.analytics.data_v1alpha.types.QueryAudienceListRequest, dict]) – The request object. A request to list users in an audience list.

  • name (str) –

    Required. The name of the audience list to retrieve users from. Format: properties/{property}/audienceLists/{audience_list}

    This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A list of users in an audience list.

Return type

google.analytics.data_v1alpha.types.QueryAudienceListResponse

static recurring_audience_list_path(property: str, recurring_audience_list: str) str[source]

Returns a fully-qualified recurring_audience_list string.

run_funnel_report(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.RunFunnelReportRequest, dict]] = None, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.RunFunnelReportResponse[source]

Returns a customized funnel report of your Google Analytics event data. The data returned from the API is as a table with columns for the requested dimensions and metrics.

Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step. For example, how do prospects become shoppers and then become buyers? How do one time buyers become repeat buyers? With this information, you can improve inefficient or abandoned customer journeys. To learn more, see GA4 Funnel Explorations.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Data API Funnel Reporting Feedback.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_run_funnel_report():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    request = data_v1alpha.RunFunnelReportRequest(
    )

    # Make the request
    response = client.run_funnel_report(request=request)

    # Handle the response
    print(response)
Parameters
Returns

The funnel report response contains two sub reports. The two sub reports are different combinations of dimensions and metrics.

Return type

google.analytics.data_v1alpha.types.RunFunnelReportResponse

sheet_export_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.SheetExportAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.analytics.data_v1alpha.types.analytics_data_api.SheetExportAudienceListResponse[source]

Exports an audience list of users to a Google Sheet. After creating an audience, the users are not immediately available for listing. First, a request to CreateAudienceList is necessary to create an audience list of users, and then second, this method is used to export those users in the audience list to a Google Sheet.

See Creating an Audience List for an introduction to Audience Lists with examples.

Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572.

This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import data_v1alpha

def sample_sheet_export_audience_list():
    # Create a client
    client = data_v1alpha.AlphaAnalyticsDataClient()

    # Initialize request argument(s)
    request = data_v1alpha.SheetExportAudienceListRequest(
        name="name_value",
    )

    # Make the request
    response = client.sheet_export_audience_list(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.analytics.data_v1alpha.types.SheetExportAudienceListRequest, dict]) – The request object. A request to export users in an audience list to a Google Sheet.

  • name (str) –

    Required. The name of the audience list to retrieve users from. Format: properties/{property}/audienceLists/{audience_list}

    This corresponds to the name field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The created Google Sheet with the list of users in an audience list.

Return type

google.analytics.data_v1alpha.types.SheetExportAudienceListResponse

property transport: google.analytics.data_v1alpha.services.alpha_analytics_data.transports.base.AlphaAnalyticsDataTransport

Returns the transport used by the client instance.

Returns

The transport used by the client

instance.

Return type

AlphaAnalyticsDataTransport

property universe_domain: str

Return the universe domain used by the client instance.

Returns

The universe domain used by the client instance.

Return type

str

class google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListAudienceListsAsyncPager(method: Callable[[...], Awaitable[google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsResponse]], request: google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsRequest, response: google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsResponse, *, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_audience_lists requests.

This class thinly wraps an initial google.analytics.data_v1alpha.types.ListAudienceListsResponse object, and provides an __aiter__ method to iterate through its audience_lists field.

If there are more pages, the __aiter__ method will make additional ListAudienceLists requests and continue to iterate through the audience_lists field on the corresponding responses.

All the usual google.analytics.data_v1alpha.types.ListAudienceListsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListAudienceListsPager(method: Callable[[...], google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsResponse], request: google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsRequest, response: google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsResponse, *, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_audience_lists requests.

This class thinly wraps an initial google.analytics.data_v1alpha.types.ListAudienceListsResponse object, and provides an __iter__ method to iterate through its audience_lists field.

If there are more pages, the __iter__ method will make additional ListAudienceLists requests and continue to iterate through the audience_lists field on the corresponding responses.

All the usual google.analytics.data_v1alpha.types.ListAudienceListsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListRecurringAudienceListsAsyncPager(method: Callable[[...], Awaitable[google.analytics.data_v1alpha.types.analytics_data_api.ListRecurringAudienceListsResponse]], request: google.analytics.data_v1alpha.types.analytics_data_api.ListRecurringAudienceListsRequest, response: google.analytics.data_v1alpha.types.analytics_data_api.ListRecurringAudienceListsResponse, *, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_recurring_audience_lists requests.

This class thinly wraps an initial google.analytics.data_v1alpha.types.ListRecurringAudienceListsResponse object, and provides an __aiter__ method to iterate through its recurring_audience_lists field.

If there are more pages, the __aiter__ method will make additional ListRecurringAudienceLists requests and continue to iterate through the recurring_audience_lists field on the corresponding responses.

All the usual google.analytics.data_v1alpha.types.ListRecurringAudienceListsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.analytics.data_v1alpha.services.alpha_analytics_data.pagers.ListRecurringAudienceListsPager(method: Callable[[...], google.analytics.data_v1alpha.types.analytics_data_api.ListRecurringAudienceListsResponse], request: google.analytics.data_v1alpha.types.analytics_data_api.ListRecurringAudienceListsRequest, response: google.analytics.data_v1alpha.types.analytics_data_api.ListRecurringAudienceListsResponse, *, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_recurring_audience_lists requests.

This class thinly wraps an initial google.analytics.data_v1alpha.types.ListRecurringAudienceListsResponse object, and provides an __iter__ method to iterate through its recurring_audience_lists field.

If there are more pages, the __iter__ method will make additional ListRecurringAudienceLists requests and continue to iterate through the recurring_audience_lists field on the corresponding responses.

All the usual google.analytics.data_v1alpha.types.ListRecurringAudienceListsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters