Class BetaAnalyticsDataClient
BetaAnalyticsData client wrapper, for convenient use.
Namespace: Google.Analytics.Data.V1Beta
Assembly: Google.Analytics.Data.V1Beta.dll
Syntax
public abstract class BetaAnalyticsDataClient
Remarks
Google Analytics reporting data service.
Properties
CreateAudienceExportOperationsClient
The long-running operations client for CreateAudienceExport
.
Declaration
public virtual OperationsClient CreateAudienceExportOperationsClient { get; }
Property Value
Type | Description |
---|---|
OperationsClient |
DefaultEndpoint
The default endpoint for the BetaAnalyticsData service, which is a host of "analyticsdata.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
Type | Description |
---|---|
string |
DefaultScopes
The default BetaAnalyticsData scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> |
Remarks
The default BetaAnalyticsData scopes are:
- https://www.googleapis.com/auth/analytics
- https://www.googleapis.com/auth/analytics.readonly
GrpcClient
The underlying gRPC BetaAnalyticsData client
Declaration
public virtual BetaAnalyticsData.BetaAnalyticsDataClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
BetaAnalyticsData.BetaAnalyticsDataClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type | Description |
---|---|
ServiceMetadata |
Methods
BatchRunPivotReports(BatchRunPivotReportsRequest, CallSettings)
Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.
Declaration
public virtual BatchRunPivotReportsResponse BatchRunPivotReports(BatchRunPivotReportsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
BatchRunPivotReportsRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
BatchRunPivotReportsResponse | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
BatchRunPivotReportsRequest request = new BatchRunPivotReportsRequest
{
Property = "",
Requests =
{
new RunPivotReportRequest(),
},
};
// Make the request
BatchRunPivotReportsResponse response = betaAnalyticsDataClient.BatchRunPivotReports(request);
BatchRunPivotReportsAsync(BatchRunPivotReportsRequest, CallSettings)
Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.
Declaration
public virtual Task<BatchRunPivotReportsResponse> BatchRunPivotReportsAsync(BatchRunPivotReportsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
BatchRunPivotReportsRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<BatchRunPivotReportsResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
BatchRunPivotReportsRequest request = new BatchRunPivotReportsRequest
{
Property = "",
Requests =
{
new RunPivotReportRequest(),
},
};
// Make the request
BatchRunPivotReportsResponse response = await betaAnalyticsDataClient.BatchRunPivotReportsAsync(request);
BatchRunPivotReportsAsync(BatchRunPivotReportsRequest, CancellationToken)
Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.
Declaration
public virtual Task<BatchRunPivotReportsResponse> BatchRunPivotReportsAsync(BatchRunPivotReportsRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
BatchRunPivotReportsRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<BatchRunPivotReportsResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
BatchRunPivotReportsRequest request = new BatchRunPivotReportsRequest
{
Property = "",
Requests =
{
new RunPivotReportRequest(),
},
};
// Make the request
BatchRunPivotReportsResponse response = await betaAnalyticsDataClient.BatchRunPivotReportsAsync(request);
BatchRunReports(BatchRunReportsRequest, CallSettings)
Returns multiple reports in a batch. All reports must be for the same GA4 Property.
Declaration
public virtual BatchRunReportsResponse BatchRunReports(BatchRunReportsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
BatchRunReportsRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
BatchRunReportsResponse | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
BatchRunReportsRequest request = new BatchRunReportsRequest
{
Property = "",
Requests =
{
new RunReportRequest(),
},
};
// Make the request
BatchRunReportsResponse response = betaAnalyticsDataClient.BatchRunReports(request);
BatchRunReportsAsync(BatchRunReportsRequest, CallSettings)
Returns multiple reports in a batch. All reports must be for the same GA4 Property.
Declaration
public virtual Task<BatchRunReportsResponse> BatchRunReportsAsync(BatchRunReportsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
BatchRunReportsRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<BatchRunReportsResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
BatchRunReportsRequest request = new BatchRunReportsRequest
{
Property = "",
Requests =
{
new RunReportRequest(),
},
};
// Make the request
BatchRunReportsResponse response = await betaAnalyticsDataClient.BatchRunReportsAsync(request);
BatchRunReportsAsync(BatchRunReportsRequest, CancellationToken)
Returns multiple reports in a batch. All reports must be for the same GA4 Property.
Declaration
public virtual Task<BatchRunReportsResponse> BatchRunReportsAsync(BatchRunReportsRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
BatchRunReportsRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<BatchRunReportsResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
BatchRunReportsRequest request = new BatchRunReportsRequest
{
Property = "",
Requests =
{
new RunReportRequest(),
},
};
// Make the request
BatchRunReportsResponse response = await betaAnalyticsDataClient.BatchRunReportsAsync(request);
CheckCompatibility(CheckCompatibilityRequest, CallSettings)
This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible.
In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible.
The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.
Declaration
public virtual CheckCompatibilityResponse CheckCompatibility(CheckCompatibilityRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CheckCompatibilityRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
CheckCompatibilityResponse | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
CheckCompatibilityRequest request = new CheckCompatibilityRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
CompatibilityFilter = Compatibility.Unspecified,
};
// Make the request
CheckCompatibilityResponse response = betaAnalyticsDataClient.CheckCompatibility(request);
CheckCompatibilityAsync(CheckCompatibilityRequest, CallSettings)
This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible.
In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible.
The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.
Declaration
public virtual Task<CheckCompatibilityResponse> CheckCompatibilityAsync(CheckCompatibilityRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CheckCompatibilityRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<CheckCompatibilityResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
CheckCompatibilityRequest request = new CheckCompatibilityRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
CompatibilityFilter = Compatibility.Unspecified,
};
// Make the request
CheckCompatibilityResponse response = await betaAnalyticsDataClient.CheckCompatibilityAsync(request);
CheckCompatibilityAsync(CheckCompatibilityRequest, CancellationToken)
This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible.
In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible.
The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.
Declaration
public virtual Task<CheckCompatibilityResponse> CheckCompatibilityAsync(CheckCompatibilityRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CheckCompatibilityRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<CheckCompatibilityResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
CheckCompatibilityRequest request = new CheckCompatibilityRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
CompatibilityFilter = Compatibility.Unspecified,
};
// Make the request
CheckCompatibilityResponse response = await betaAnalyticsDataClient.CheckCompatibilityAsync(request);
Create()
Synchronously creates a BetaAnalyticsDataClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BetaAnalyticsDataClientBuilder.
Declaration
public static BetaAnalyticsDataClient Create()
Returns
Type | Description |
---|---|
BetaAnalyticsDataClient | The created BetaAnalyticsDataClient. |
CreateAsync(CancellationToken)
Asynchronously creates a BetaAnalyticsDataClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use BetaAnalyticsDataClientBuilder.
Declaration
public static Task<BetaAnalyticsDataClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
Task<BetaAnalyticsDataClient> | The task representing the created BetaAnalyticsDataClient. |
CreateAudienceExport(CreateAudienceExportRequest, CallSettings)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Operation<AudienceExport, AudienceExportMetadata> CreateAudienceExport(CreateAudienceExportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CreateAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Operation<AudienceExport, AudienceExportMetadata> | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
CreateAudienceExportRequest request = new CreateAudienceExportRequest
{
ParentAsPropertyName = PropertyName.FromProperty("[PROPERTY]"),
AudienceExport = new AudienceExport(),
};
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = betaAnalyticsDataClient.CreateAudienceExport(request);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = betaAnalyticsDataClient.PollOnceCreateAudienceExport(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
CreateAudienceExport(PropertyName, AudienceExport, CallSettings)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Operation<AudienceExport, AudienceExportMetadata> CreateAudienceExport(PropertyName parent, AudienceExport audienceExport, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyName | parent | Required. The parent resource where this audience export will be created.
Format: |
AudienceExport | audienceExport | Required. The audience export to create. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Operation<AudienceExport, AudienceExportMetadata> | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
PropertyName parent = PropertyName.FromProperty("[PROPERTY]");
AudienceExport audienceExport = new AudienceExport();
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = betaAnalyticsDataClient.CreateAudienceExport(parent, audienceExport);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = betaAnalyticsDataClient.PollOnceCreateAudienceExport(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
CreateAudienceExport(string, AudienceExport, CallSettings)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Operation<AudienceExport, AudienceExportMetadata> CreateAudienceExport(string parent, AudienceExport audienceExport, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The parent resource where this audience export will be created.
Format: |
AudienceExport | audienceExport | Required. The audience export to create. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Operation<AudienceExport, AudienceExportMetadata> | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
string parent = "properties/[PROPERTY]";
AudienceExport audienceExport = new AudienceExport();
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = betaAnalyticsDataClient.CreateAudienceExport(parent, audienceExport);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = betaAnalyticsDataClient.PollOnceCreateAudienceExport(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
CreateAudienceExportAsync(CreateAudienceExportRequest, CallSettings)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<Operation<AudienceExport, AudienceExportMetadata>> CreateAudienceExportAsync(CreateAudienceExportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CreateAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Operation<AudienceExport, AudienceExportMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
CreateAudienceExportRequest request = new CreateAudienceExportRequest
{
ParentAsPropertyName = PropertyName.FromProperty("[PROPERTY]"),
AudienceExport = new AudienceExport(),
};
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = await betaAnalyticsDataClient.CreateAudienceExportAsync(request);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = await betaAnalyticsDataClient.PollOnceCreateAudienceExportAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
CreateAudienceExportAsync(CreateAudienceExportRequest, CancellationToken)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<Operation<AudienceExport, AudienceExportMetadata>> CreateAudienceExportAsync(CreateAudienceExportRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CreateAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Operation<AudienceExport, AudienceExportMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
CreateAudienceExportRequest request = new CreateAudienceExportRequest
{
ParentAsPropertyName = PropertyName.FromProperty("[PROPERTY]"),
AudienceExport = new AudienceExport(),
};
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = await betaAnalyticsDataClient.CreateAudienceExportAsync(request);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = await betaAnalyticsDataClient.PollOnceCreateAudienceExportAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
CreateAudienceExportAsync(PropertyName, AudienceExport, CallSettings)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<Operation<AudienceExport, AudienceExportMetadata>> CreateAudienceExportAsync(PropertyName parent, AudienceExport audienceExport, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyName | parent | Required. The parent resource where this audience export will be created.
Format: |
AudienceExport | audienceExport | Required. The audience export to create. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Operation<AudienceExport, AudienceExportMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
PropertyName parent = PropertyName.FromProperty("[PROPERTY]");
AudienceExport audienceExport = new AudienceExport();
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = await betaAnalyticsDataClient.CreateAudienceExportAsync(parent, audienceExport);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = await betaAnalyticsDataClient.PollOnceCreateAudienceExportAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
CreateAudienceExportAsync(PropertyName, AudienceExport, CancellationToken)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<Operation<AudienceExport, AudienceExportMetadata>> CreateAudienceExportAsync(PropertyName parent, AudienceExport audienceExport, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
PropertyName | parent | Required. The parent resource where this audience export will be created.
Format: |
AudienceExport | audienceExport | Required. The audience export to create. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Operation<AudienceExport, AudienceExportMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
PropertyName parent = PropertyName.FromProperty("[PROPERTY]");
AudienceExport audienceExport = new AudienceExport();
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = await betaAnalyticsDataClient.CreateAudienceExportAsync(parent, audienceExport);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = await betaAnalyticsDataClient.PollOnceCreateAudienceExportAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
CreateAudienceExportAsync(string, AudienceExport, CallSettings)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<Operation<AudienceExport, AudienceExportMetadata>> CreateAudienceExportAsync(string parent, AudienceExport audienceExport, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The parent resource where this audience export will be created.
Format: |
AudienceExport | audienceExport | Required. The audience export to create. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Operation<AudienceExport, AudienceExportMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string parent = "properties/[PROPERTY]";
AudienceExport audienceExport = new AudienceExport();
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = await betaAnalyticsDataClient.CreateAudienceExportAsync(parent, audienceExport);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = await betaAnalyticsDataClient.PollOnceCreateAudienceExportAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
CreateAudienceExportAsync(string, AudienceExport, CancellationToken)
Creates an audience export for later retrieval. This method quickly returns
the audience export's resource name and initiates a long running
asynchronous request to form an audience export. To export the users in an
audience export, first create the audience export through this method and
then send the audience resource name to the QueryAudienceExport
method.
See Creating an Audience Export for an introduction to Audience Exports with examples.
An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports 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 exports contain the users in each audience.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<Operation<AudienceExport, AudienceExportMetadata>> CreateAudienceExportAsync(string parent, AudienceExport audienceExport, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The parent resource where this audience export will be created.
Format: |
AudienceExport | audienceExport | Required. The audience export to create. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Operation<AudienceExport, AudienceExportMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string parent = "properties/[PROPERTY]";
AudienceExport audienceExport = new AudienceExport();
// Make the request
Operation<AudienceExport, AudienceExportMetadata> response = await betaAnalyticsDataClient.CreateAudienceExportAsync(parent, audienceExport);
// Poll until the returned long-running operation is complete
Operation<AudienceExport, AudienceExportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AudienceExport result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AudienceExport, AudienceExportMetadata> retrievedResponse = await betaAnalyticsDataClient.PollOnceCreateAudienceExportAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AudienceExport retrievedResult = retrievedResponse.Result;
}
GetAudienceExport(AudienceExportName, CallSettings)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual AudienceExport GetAudienceExport(AudienceExportName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AudienceExportName | name | Required. The audience export resource name.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
AudienceExport | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
AudienceExportName name = AudienceExportName.FromPropertyAudienceExport("[PROPERTY]", "[AUDIENCE_EXPORT]");
// Make the request
AudienceExport response = betaAnalyticsDataClient.GetAudienceExport(name);
GetAudienceExport(GetAudienceExportRequest, CallSettings)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual AudienceExport GetAudienceExport(GetAudienceExportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
AudienceExport | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
GetAudienceExportRequest request = new GetAudienceExportRequest
{
AudienceExportName = AudienceExportName.FromPropertyAudienceExport("[PROPERTY]", "[AUDIENCE_EXPORT]"),
};
// Make the request
AudienceExport response = betaAnalyticsDataClient.GetAudienceExport(request);
GetAudienceExport(string, CallSettings)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual AudienceExport GetAudienceExport(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The audience export resource name.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
AudienceExport | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
string name = "properties/[PROPERTY]/audienceExports/[AUDIENCE_EXPORT]";
// Make the request
AudienceExport response = betaAnalyticsDataClient.GetAudienceExport(name);
GetAudienceExportAsync(AudienceExportName, CallSettings)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<AudienceExport> GetAudienceExportAsync(AudienceExportName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AudienceExportName | name | Required. The audience export resource name.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<AudienceExport> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
AudienceExportName name = AudienceExportName.FromPropertyAudienceExport("[PROPERTY]", "[AUDIENCE_EXPORT]");
// Make the request
AudienceExport response = await betaAnalyticsDataClient.GetAudienceExportAsync(name);
GetAudienceExportAsync(AudienceExportName, CancellationToken)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<AudienceExport> GetAudienceExportAsync(AudienceExportName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AudienceExportName | name | Required. The audience export resource name.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<AudienceExport> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
AudienceExportName name = AudienceExportName.FromPropertyAudienceExport("[PROPERTY]", "[AUDIENCE_EXPORT]");
// Make the request
AudienceExport response = await betaAnalyticsDataClient.GetAudienceExportAsync(name);
GetAudienceExportAsync(GetAudienceExportRequest, CallSettings)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<AudienceExport> GetAudienceExportAsync(GetAudienceExportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<AudienceExport> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
GetAudienceExportRequest request = new GetAudienceExportRequest
{
AudienceExportName = AudienceExportName.FromPropertyAudienceExport("[PROPERTY]", "[AUDIENCE_EXPORT]"),
};
// Make the request
AudienceExport response = await betaAnalyticsDataClient.GetAudienceExportAsync(request);
GetAudienceExportAsync(GetAudienceExportRequest, CancellationToken)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<AudienceExport> GetAudienceExportAsync(GetAudienceExportRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GetAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<AudienceExport> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
GetAudienceExportRequest request = new GetAudienceExportRequest
{
AudienceExportName = AudienceExportName.FromPropertyAudienceExport("[PROPERTY]", "[AUDIENCE_EXPORT]"),
};
// Make the request
AudienceExport response = await betaAnalyticsDataClient.GetAudienceExportAsync(request);
GetAudienceExportAsync(string, CallSettings)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<AudienceExport> GetAudienceExportAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The audience export resource name.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<AudienceExport> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string name = "properties/[PROPERTY]/audienceExports/[AUDIENCE_EXPORT]";
// Make the request
AudienceExport response = await betaAnalyticsDataClient.GetAudienceExportAsync(name);
GetAudienceExportAsync(string, CancellationToken)
Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<AudienceExport> GetAudienceExportAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The audience export resource name.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<AudienceExport> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string name = "properties/[PROPERTY]/audienceExports/[AUDIENCE_EXPORT]";
// Make the request
AudienceExport response = await betaAnalyticsDataClient.GetAudienceExportAsync(name);
GetMetadata(GetMetadataRequest, CallSettings)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Metadata GetMetadata(GetMetadataRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetMetadataRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Metadata | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
GetMetadataRequest request = new GetMetadataRequest
{
MetadataName = MetadataName.FromProperty("[PROPERTY]"),
};
// Make the request
Metadata response = betaAnalyticsDataClient.GetMetadata(request);
GetMetadata(MetadataName, CallSettings)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Metadata GetMetadata(MetadataName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
MetadataName | name | Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID. Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Metadata | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
MetadataName name = MetadataName.FromProperty("[PROPERTY]");
// Make the request
Metadata response = betaAnalyticsDataClient.GetMetadata(name);
GetMetadata(string, CallSettings)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Metadata GetMetadata(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID. Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Metadata | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
string name = "properties/[PROPERTY]/metadata";
// Make the request
Metadata response = betaAnalyticsDataClient.GetMetadata(name);
GetMetadataAsync(GetMetadataRequest, CallSettings)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Task<Metadata> GetMetadataAsync(GetMetadataRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetMetadataRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Metadata> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
GetMetadataRequest request = new GetMetadataRequest
{
MetadataName = MetadataName.FromProperty("[PROPERTY]"),
};
// Make the request
Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(request);
GetMetadataAsync(GetMetadataRequest, CancellationToken)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Task<Metadata> GetMetadataAsync(GetMetadataRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GetMetadataRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Metadata> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
GetMetadataRequest request = new GetMetadataRequest
{
MetadataName = MetadataName.FromProperty("[PROPERTY]"),
};
// Make the request
Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(request);
GetMetadataAsync(MetadataName, CallSettings)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Task<Metadata> GetMetadataAsync(MetadataName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
MetadataName | name | Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID. Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Metadata> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
MetadataName name = MetadataName.FromProperty("[PROPERTY]");
// Make the request
Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(name);
GetMetadataAsync(MetadataName, CancellationToken)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Task<Metadata> GetMetadataAsync(MetadataName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
MetadataName | name | Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID. Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Metadata> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
MetadataName name = MetadataName.FromProperty("[PROPERTY]");
// Make the request
Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(name);
GetMetadataAsync(string, CallSettings)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Task<Metadata> GetMetadataAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID. Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Metadata> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string name = "properties/[PROPERTY]/metadata";
// Make the request
Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(name);
GetMetadataAsync(string, CancellationToken)
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is
registered to a property, the Metadata response will contain
customEvent:levels_unlocked
. Universal metadata are dimensions and
metrics applicable to any property such as country
and totalUsers
.
Declaration
public virtual Task<Metadata> GetMetadataAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID. Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Metadata> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string name = "properties/[PROPERTY]/metadata";
// Make the request
Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(name);
ListAudienceExports(ListAudienceExportsRequest, CallSettings)
Lists all audience exports for a property. This method can be used for you to find and reuse existing audience exports rather than creating unnecessary new audience exports. The same audience can have multiple audience exports that represent the export of users that were in an audience on different days.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual PagedEnumerable<ListAudienceExportsResponse, AudienceExport> ListAudienceExports(ListAudienceExportsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ListAudienceExportsRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PagedEnumerable<ListAudienceExportsResponse, AudienceExport> | A pageable sequence of AudienceExport resources. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
ListAudienceExportsRequest request = new ListAudienceExportsRequest
{
ParentAsPropertyName = PropertyName.FromProperty("[PROPERTY]"),
};
// Make the request
PagedEnumerable<ListAudienceExportsResponse, AudienceExport> response = betaAnalyticsDataClient.ListAudienceExports(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (AudienceExport item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAudienceExportsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AudienceExport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AudienceExport> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AudienceExport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAudienceExports(PropertyName, string, int?, CallSettings)
Lists all audience exports for a property. This method can be used for you to find and reuse existing audience exports rather than creating unnecessary new audience exports. The same audience can have multiple audience exports that represent the export of users that were in an audience on different days.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual PagedEnumerable<ListAudienceExportsResponse, AudienceExport> ListAudienceExports(PropertyName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyName | parent | Required. All audience exports for this property will be listed in the
response. Format: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PagedEnumerable<ListAudienceExportsResponse, AudienceExport> | A pageable sequence of AudienceExport resources. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
PropertyName parent = PropertyName.FromProperty("[PROPERTY]");
// Make the request
PagedEnumerable<ListAudienceExportsResponse, AudienceExport> response = betaAnalyticsDataClient.ListAudienceExports(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AudienceExport item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAudienceExportsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AudienceExport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AudienceExport> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AudienceExport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAudienceExports(string, string, int?, CallSettings)
Lists all audience exports for a property. This method can be used for you to find and reuse existing audience exports rather than creating unnecessary new audience exports. The same audience can have multiple audience exports that represent the export of users that were in an audience on different days.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual PagedEnumerable<ListAudienceExportsResponse, AudienceExport> ListAudienceExports(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. All audience exports for this property will be listed in the
response. Format: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PagedEnumerable<ListAudienceExportsResponse, AudienceExport> | A pageable sequence of AudienceExport resources. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
string parent = "properties/[PROPERTY]";
// Make the request
PagedEnumerable<ListAudienceExportsResponse, AudienceExport> response = betaAnalyticsDataClient.ListAudienceExports(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AudienceExport item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAudienceExportsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AudienceExport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AudienceExport> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AudienceExport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAudienceExportsAsync(ListAudienceExportsRequest, CallSettings)
Lists all audience exports for a property. This method can be used for you to find and reuse existing audience exports rather than creating unnecessary new audience exports. The same audience can have multiple audience exports that represent the export of users that were in an audience on different days.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> ListAudienceExportsAsync(ListAudienceExportsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ListAudienceExportsRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> | A pageable asynchronous sequence of AudienceExport resources. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
ListAudienceExportsRequest request = new ListAudienceExportsRequest
{
ParentAsPropertyName = PropertyName.FromProperty("[PROPERTY]"),
};
// Make the request
PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> response = betaAnalyticsDataClient.ListAudienceExportsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AudienceExport item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAudienceExportsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AudienceExport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AudienceExport> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AudienceExport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAudienceExportsAsync(PropertyName, string, int?, CallSettings)
Lists all audience exports for a property. This method can be used for you to find and reuse existing audience exports rather than creating unnecessary new audience exports. The same audience can have multiple audience exports that represent the export of users that were in an audience on different days.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> ListAudienceExportsAsync(PropertyName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyName | parent | Required. All audience exports for this property will be listed in the
response. Format: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> | A pageable asynchronous sequence of AudienceExport resources. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
PropertyName parent = PropertyName.FromProperty("[PROPERTY]");
// Make the request
PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> response = betaAnalyticsDataClient.ListAudienceExportsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AudienceExport item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAudienceExportsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AudienceExport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AudienceExport> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AudienceExport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAudienceExportsAsync(string, string, int?, CallSettings)
Lists all audience exports for a property. This method can be used for you to find and reuse existing audience exports rather than creating unnecessary new audience exports. The same audience can have multiple audience exports that represent the export of users that were in an audience on different days.
See Creating an Audience Export for an introduction to Audience Exports with examples.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> ListAudienceExportsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. All audience exports for this property will be listed in the
response. Format: |
string | pageToken | The token returned from the previous request. A value of |
int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> | A pageable asynchronous sequence of AudienceExport resources. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string parent = "properties/[PROPERTY]";
// Make the request
PagedAsyncEnumerable<ListAudienceExportsResponse, AudienceExport> response = betaAnalyticsDataClient.ListAudienceExportsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AudienceExport item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAudienceExportsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AudienceExport item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AudienceExport> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AudienceExport item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
PollOnceCreateAudienceExport(string, CallSettings)
Poll an operation once, using an operationName
from a previous invocation of CreateAudienceExport
.
Declaration
public virtual Operation<AudienceExport, AudienceExportMetadata> PollOnceCreateAudienceExport(string operationName, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | operationName | The name of a previously invoked operation. Must not be |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Operation<AudienceExport, AudienceExportMetadata> | The result of polling the operation. |
PollOnceCreateAudienceExportAsync(string, CallSettings)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
CreateAudienceExport
.
Declaration
public virtual Task<Operation<AudienceExport, AudienceExportMetadata>> PollOnceCreateAudienceExportAsync(string operationName, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | operationName | The name of a previously invoked operation. Must not be |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Operation<AudienceExport, AudienceExportMetadata>> | A task representing the result of polling the operation. |
QueryAudienceExport(QueryAudienceExportRequest, CallSettings)
Retrieves an audience export of users. After creating an audience, the
users are not immediately available for exporting. First, a request to
CreateAudienceExport
is necessary to create an audience export of users,
and then second, this method is used to retrieve the users in the audience
export.
See Creating an Audience Export for an introduction to Audience Exports 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.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual QueryAudienceExportResponse QueryAudienceExport(QueryAudienceExportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
QueryAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
QueryAudienceExportResponse | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
QueryAudienceExportRequest request = new QueryAudienceExportRequest
{
Name = "",
Offset = 0L,
Limit = 0L,
};
// Make the request
QueryAudienceExportResponse response = betaAnalyticsDataClient.QueryAudienceExport(request);
QueryAudienceExport(string, CallSettings)
Retrieves an audience export of users. After creating an audience, the
users are not immediately available for exporting. First, a request to
CreateAudienceExport
is necessary to create an audience export of users,
and then second, this method is used to retrieve the users in the audience
export.
See Creating an Audience Export for an introduction to Audience Exports 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.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual QueryAudienceExportResponse QueryAudienceExport(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the audience export to retrieve users from.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
QueryAudienceExportResponse | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
QueryAudienceExportResponse response = betaAnalyticsDataClient.QueryAudienceExport(name);
QueryAudienceExportAsync(QueryAudienceExportRequest, CallSettings)
Retrieves an audience export of users. After creating an audience, the
users are not immediately available for exporting. First, a request to
CreateAudienceExport
is necessary to create an audience export of users,
and then second, this method is used to retrieve the users in the audience
export.
See Creating an Audience Export for an introduction to Audience Exports 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.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<QueryAudienceExportResponse> QueryAudienceExportAsync(QueryAudienceExportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
QueryAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<QueryAudienceExportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
QueryAudienceExportRequest request = new QueryAudienceExportRequest
{
Name = "",
Offset = 0L,
Limit = 0L,
};
// Make the request
QueryAudienceExportResponse response = await betaAnalyticsDataClient.QueryAudienceExportAsync(request);
QueryAudienceExportAsync(QueryAudienceExportRequest, CancellationToken)
Retrieves an audience export of users. After creating an audience, the
users are not immediately available for exporting. First, a request to
CreateAudienceExport
is necessary to create an audience export of users,
and then second, this method is used to retrieve the users in the audience
export.
See Creating an Audience Export for an introduction to Audience Exports 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.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<QueryAudienceExportResponse> QueryAudienceExportAsync(QueryAudienceExportRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
QueryAudienceExportRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<QueryAudienceExportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
QueryAudienceExportRequest request = new QueryAudienceExportRequest
{
Name = "",
Offset = 0L,
Limit = 0L,
};
// Make the request
QueryAudienceExportResponse response = await betaAnalyticsDataClient.QueryAudienceExportAsync(request);
QueryAudienceExportAsync(string, CallSettings)
Retrieves an audience export of users. After creating an audience, the
users are not immediately available for exporting. First, a request to
CreateAudienceExport
is necessary to create an audience export of users,
and then second, this method is used to retrieve the users in the audience
export.
See Creating an Audience Export for an introduction to Audience Exports 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.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<QueryAudienceExportResponse> QueryAudienceExportAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the audience export to retrieve users from.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<QueryAudienceExportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
QueryAudienceExportResponse response = await betaAnalyticsDataClient.QueryAudienceExportAsync(name);
QueryAudienceExportAsync(string, CancellationToken)
Retrieves an audience export of users. After creating an audience, the
users are not immediately available for exporting. First, a request to
CreateAudienceExport
is necessary to create an audience export of users,
and then second, this method is used to retrieve the users in the audience
export.
See Creating an Audience Export for an introduction to Audience Exports 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.
Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
Declaration
public virtual Task<QueryAudienceExportResponse> QueryAudienceExportAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the audience export to retrieve users from.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<QueryAudienceExportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
QueryAudienceExportResponse response = await betaAnalyticsDataClient.QueryAudienceExportAsync(name);
RunPivotReport(RunPivotReportRequest, CallSettings)
Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.
Declaration
public virtual RunPivotReportResponse RunPivotReport(RunPivotReportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RunPivotReportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
RunPivotReportResponse | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
RunPivotReportRequest request = new RunPivotReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DateRanges = { new DateRange(), },
Pivots = { new Pivot(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
CurrencyCode = "",
CohortSpec = new CohortSpec(),
KeepEmptyRows = false,
ReturnPropertyQuota = false,
Comparisons = { new Comparison(), },
};
// Make the request
RunPivotReportResponse response = betaAnalyticsDataClient.RunPivotReport(request);
RunPivotReportAsync(RunPivotReportRequest, CallSettings)
Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.
Declaration
public virtual Task<RunPivotReportResponse> RunPivotReportAsync(RunPivotReportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RunPivotReportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<RunPivotReportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
RunPivotReportRequest request = new RunPivotReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DateRanges = { new DateRange(), },
Pivots = { new Pivot(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
CurrencyCode = "",
CohortSpec = new CohortSpec(),
KeepEmptyRows = false,
ReturnPropertyQuota = false,
Comparisons = { new Comparison(), },
};
// Make the request
RunPivotReportResponse response = await betaAnalyticsDataClient.RunPivotReportAsync(request);
RunPivotReportAsync(RunPivotReportRequest, CancellationToken)
Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.
Declaration
public virtual Task<RunPivotReportResponse> RunPivotReportAsync(RunPivotReportRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
RunPivotReportRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<RunPivotReportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
RunPivotReportRequest request = new RunPivotReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DateRanges = { new DateRange(), },
Pivots = { new Pivot(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
CurrencyCode = "",
CohortSpec = new CohortSpec(),
KeepEmptyRows = false,
ReturnPropertyQuota = false,
Comparisons = { new Comparison(), },
};
// Make the request
RunPivotReportResponse response = await betaAnalyticsDataClient.RunPivotReportAsync(request);
RunRealtimeReport(RunRealtimeReportRequest, CallSettings)
Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties).
For a guide to constructing realtime requests & understanding responses, see Creating a Realtime Report.
Declaration
public virtual RunRealtimeReportResponse RunRealtimeReport(RunRealtimeReportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RunRealtimeReportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
RunRealtimeReportResponse | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
RunRealtimeReportRequest request = new RunRealtimeReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
Limit = 0L,
MetricAggregations =
{
MetricAggregation.Unspecified,
},
OrderBys = { new OrderBy(), },
ReturnPropertyQuota = false,
MinuteRanges = { new MinuteRange(), },
};
// Make the request
RunRealtimeReportResponse response = betaAnalyticsDataClient.RunRealtimeReport(request);
RunRealtimeReportAsync(RunRealtimeReportRequest, CallSettings)
Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties).
For a guide to constructing realtime requests & understanding responses, see Creating a Realtime Report.
Declaration
public virtual Task<RunRealtimeReportResponse> RunRealtimeReportAsync(RunRealtimeReportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RunRealtimeReportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<RunRealtimeReportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
RunRealtimeReportRequest request = new RunRealtimeReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
Limit = 0L,
MetricAggregations =
{
MetricAggregation.Unspecified,
},
OrderBys = { new OrderBy(), },
ReturnPropertyQuota = false,
MinuteRanges = { new MinuteRange(), },
};
// Make the request
RunRealtimeReportResponse response = await betaAnalyticsDataClient.RunRealtimeReportAsync(request);
RunRealtimeReportAsync(RunRealtimeReportRequest, CancellationToken)
Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties).
For a guide to constructing realtime requests & understanding responses, see Creating a Realtime Report.
Declaration
public virtual Task<RunRealtimeReportResponse> RunRealtimeReportAsync(RunRealtimeReportRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
RunRealtimeReportRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<RunRealtimeReportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
RunRealtimeReportRequest request = new RunRealtimeReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
Limit = 0L,
MetricAggregations =
{
MetricAggregation.Unspecified,
},
OrderBys = { new OrderBy(), },
ReturnPropertyQuota = false,
MinuteRanges = { new MinuteRange(), },
};
// Make the request
RunRealtimeReportResponse response = await betaAnalyticsDataClient.RunRealtimeReportAsync(request);
RunReport(RunReportRequest, CallSettings)
Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.
For a guide to constructing requests & understanding responses, see Creating a Report.
Declaration
public virtual RunReportResponse RunReport(RunReportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RunReportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
RunReportResponse | The RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = BetaAnalyticsDataClient.Create();
// Initialize request argument(s)
RunReportRequest request = new RunReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DateRanges = { new DateRange(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
Offset = 0L,
Limit = 0L,
MetricAggregations =
{
MetricAggregation.Unspecified,
},
OrderBys = { new OrderBy(), },
CurrencyCode = "",
CohortSpec = new CohortSpec(),
KeepEmptyRows = false,
ReturnPropertyQuota = false,
Comparisons = { new Comparison(), },
};
// Make the request
RunReportResponse response = betaAnalyticsDataClient.RunReport(request);
RunReportAsync(RunReportRequest, CallSettings)
Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.
For a guide to constructing requests & understanding responses, see Creating a Report.
Declaration
public virtual Task<RunReportResponse> RunReportAsync(RunReportRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RunReportRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<RunReportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
RunReportRequest request = new RunReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DateRanges = { new DateRange(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
Offset = 0L,
Limit = 0L,
MetricAggregations =
{
MetricAggregation.Unspecified,
},
OrderBys = { new OrderBy(), },
CurrencyCode = "",
CohortSpec = new CohortSpec(),
KeepEmptyRows = false,
ReturnPropertyQuota = false,
Comparisons = { new Comparison(), },
};
// Make the request
RunReportResponse response = await betaAnalyticsDataClient.RunReportAsync(request);
RunReportAsync(RunReportRequest, CancellationToken)
Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.
For a guide to constructing requests & understanding responses, see Creating a Report.
Declaration
public virtual Task<RunReportResponse> RunReportAsync(RunReportRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
RunReportRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<RunReportResponse> | A Task containing the RPC response. |
Sample code
// Create client
BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();
// Initialize request argument(s)
RunReportRequest request = new RunReportRequest
{
Property = "",
Dimensions = { new Dimension(), },
Metrics = { new Metric(), },
DateRanges = { new DateRange(), },
DimensionFilter = new FilterExpression(),
MetricFilter = new FilterExpression(),
Offset = 0L,
Limit = 0L,
MetricAggregations =
{
MetricAggregation.Unspecified,
},
OrderBys = { new OrderBy(), },
CurrencyCode = "",
CohortSpec = new CohortSpec(),
KeepEmptyRows = false,
ReturnPropertyQuota = false,
Comparisons = { new Comparison(), },
};
// Make the request
RunReportResponse response = await betaAnalyticsDataClient.RunReportAsync(request);
ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous shutdown operation. |
Remarks
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.