AlphaAnalyticsData¶
- class google.analytics.data_v1alpha.services.alpha_analytics_data.AlphaAnalyticsDataAsyncClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Union[str, google.analytics.data_v1alpha.services.alpha_analytics_data.transports.base.AlphaAnalyticsDataTransport] = 'grpc_asyncio', client_options: 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 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 (ClientOptions) – Custom options for the client. It won’t take effect if a
transportinstance is provided. (1) Theapi_endpointproperty can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT environment variable can also be used to override the endpoint: “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). However, theapi_endpointproperty takes precedence if provided. (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then theclient_cert_sourceproperty can be used to provide client certificate for mutual TLS 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.
- Raises
google.auth.exceptions.MutualTlsChannelError – If mutual TLS transport creation failed for any reason.
- static audience_list_path(propertyId: str, audienceListId: 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_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.
- 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: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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
QueryAudienceListmethod.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 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/{propertyId}This corresponds to the
parentfield on therequestinstance; ifrequestis 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_listfield on therequestinstance; ifrequestis 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.AudienceListAn 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.
- The result type for the operation will be
- Return type
- 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
- 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
- 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
- async get_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.GetAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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.
# 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/{propertyId}/audienceLists/{audienceListId}This corresponds to the
namefield on therequestinstance; ifrequestis 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
- 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
- Raises
google.auth.exceptions.MutualTLSChannelError – If any errors happen.
- 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: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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.
# 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/{propertyId}This corresponds to the
parentfield on therequestinstance; ifrequestis 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.ListAudienceListsAsyncPager
- 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.
- async query_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.QueryAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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
CreateAudienceListis necessary to create an audience list of users, and then second, this method is used to retrieve the users in 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.
# 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( ) # 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) –The name of the audience list to retrieve users from. Format:
properties/{propertyId}/audienceLists/{audienceListId}This corresponds to the
namefield on therequestinstance; ifrequestis 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
- async run_funnel_report(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.RunFunnelReportRequest, dict]] = None, *, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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.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 funnel report response contains two sub reports. The two sub reports are different combinations of dimensions and metrics.
- Return type
- 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
- class google.analytics.data_v1alpha.services.alpha_analytics_data.AlphaAnalyticsDataClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.analytics.data_v1alpha.services.alpha_analytics_data.transports.base.AlphaAnalyticsDataTransport]] = None, client_options: Optional[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. It won’t take effect if a
transportinstance is provided. (1) Theapi_endpointproperty can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT environment variable can also be used to override the endpoint: “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). However, theapi_endpointproperty takes precedence if provided. (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then theclient_cert_sourceproperty can be used to provide client certificate for mutual TLS 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.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!
- static audience_list_path(propertyId: str, audienceListId: 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_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.
- 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: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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
QueryAudienceListmethod.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 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/{propertyId}This corresponds to the
parentfield on therequestinstance; ifrequestis 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_listfield on therequestinstance; ifrequestis 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.AudienceListAn 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.
- The result type for the operation will be
- Return type
- 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
- 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
- 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
- get_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.GetAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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.
# 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/{propertyId}/audienceLists/{audienceListId}This corresponds to the
namefield on therequestinstance; ifrequestis 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
- 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
- Raises
google.auth.exceptions.MutualTLSChannelError – If any errors happen.
- list_audience_lists(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.ListAudienceListsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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.
# 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/{propertyId}This corresponds to the
parentfield on therequestinstance; ifrequestis 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
- 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.
- query_audience_list(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.QueryAudienceListRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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
CreateAudienceListis necessary to create an audience list of users, and then second, this method is used to retrieve the users in 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.
# 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( ) # 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) –
The name of the audience list to retrieve users from. Format:
properties/{propertyId}/audienceLists/{audienceListId}This corresponds to the
namefield on therequestinstance; ifrequestis 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
- run_funnel_report(request: Optional[Union[google.analytics.data_v1alpha.types.analytics_data_api.RunFunnelReportRequest, dict]] = None, *, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, 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
request (Union[google.analytics.data_v1alpha.types.RunFunnelReportRequest, dict]) – The request object. The request for a funnel report.
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 funnel report response contains two sub reports. The two sub reports are different combinations of dimensions and metrics.
- Return type
- 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
- 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_listsrequests.This class thinly wraps an initial
google.analytics.data_v1alpha.types.ListAudienceListsResponseobject, and provides an__aiter__method to iterate through itsaudience_listsfield.If there are more pages, the
__aiter__method will make additionalListAudienceListsrequests and continue to iterate through theaudience_listsfield on the corresponding responses.All the usual
google.analytics.data_v1alpha.types.ListAudienceListsResponseattributes 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
method (Callable) – The method that was originally called, and which instantiated this pager.
request (google.analytics.data_v1alpha.types.ListAudienceListsRequest) – The initial request object.
response (google.analytics.data_v1alpha.types.ListAudienceListsResponse) – The initial response object.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- 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_listsrequests.This class thinly wraps an initial
google.analytics.data_v1alpha.types.ListAudienceListsResponseobject, and provides an__iter__method to iterate through itsaudience_listsfield.If there are more pages, the
__iter__method will make additionalListAudienceListsrequests and continue to iterate through theaudience_listsfield on the corresponding responses.All the usual
google.analytics.data_v1alpha.types.ListAudienceListsResponseattributes 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
method (Callable) – The method that was originally called, and which instantiated this pager.
request (google.analytics.data_v1alpha.types.ListAudienceListsRequest) – The initial request object.
response (google.analytics.data_v1alpha.types.ListAudienceListsResponse) – The initial response object.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.