Google Analytics reporting data service. v1alpha
Package
@google-analytics/dataConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of AlphaAnalyticsDataClient.
opts
ClientOptions
gaxInstance
typeof gax
| typeof fallback
: loaded instance of google-gax
. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new AlphaAnalyticsDataClient({fallback: true}, gax); ```
Properties
alphaAnalyticsDataStub
alphaAnalyticsDataStub
?:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
apiEndpoint
get
apiEndpoint
()
:
string
;
The DNS address for this API service.
apiEndpoint
static
get
apiEndpoint
()
:
string
;
The DNS address for this API service - same as servicePath.
auth
auth
:
gax
.
GoogleAuth
;
descriptors
descriptors
:
Descriptors
;
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
operationsClient
operationsClient
:
gax
.
OperationsClient
;
pathTemplates
pathTemplates
:
{
[
name
:
string
]
:
gax
.
PathTemplate
;
};
port
static
get
port
()
:
number
;
The port for this API service.
scopes
static
get
scopes
()
:
string
[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static
get
servicePath
()
:
string
;
The DNS address for this API service.
universeDomain
get
universeDomain
()
:
string
;
warn
warn
:
(
code
:
string
,
message
:
string
,
warnType
?:
string
)
=
>
void
;
Methods
audienceListPath(property, audienceList)
audienceListPath
(
property
:
string
,
audienceList
:
string
)
:
string
;
Return a fully-qualified audienceList resource name string.
property
string
audienceList
string
string
{string} Resource name string.
cancelOperation(request, options, callback)
cancelOperation
(
request
:
protos
.
google
.
longrunning
.
CancelOperationRequest
,
options
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
longrunning
.
CancelOperationRequest
,
{}
|
undefined
|
null
> ,
callback
?:
Callback<protos
.
google
.
longrunning
.
CancelOperationRequest
,
protos
.
google
.
protobuf
.
Empty
,
{}
|
undefined
|
null
> )
:
Promise<protos
.
google
.
protobuf
.
Empty
> ;
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED
.
request
options
CallOptions
| Callback
< protos.google.protobuf.Empty
, protos.google.longrunning.CancelOperationRequest
, {} | undefined | null>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
callback
Callback
< protos.google.longrunning.CancelOperationRequest
, protos.google.protobuf.Empty
, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
const
client
=
longrunning
.
operationsClient
();
await
client
.
cancelOperation
({
name
:
''
});
checkCreateAudienceListProgress(name)
checkCreateAudienceListProgress
(
name
:
string
)
:
Promise<LROperation<protos
.
google
.
analytics
.
data
.
v1alpha
.
AudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
AudienceListMetadata
>> ;
Check the status of the long running operation returned by createAudienceList()
.
name
string
The operation name that will be passed.
Promise
< LROperation
< protos.google.analytics.data.v1alpha.AudienceList
, protos.google.analytics.data.v1alpha.AudienceListMetadata
>>
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource where this audience list will be created.
* Format: `properties/{property}`
*/
// const parent = 'abc123'
/**
* Required. The audience list to create.
*/
// const audienceList = {}
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callCreateAudienceList
()
{
// Construct request
const
request
=
{
parent
,
audienceList
,
};
// Run request
const
[
operation
]
=
await
dataClient
.
createAudienceList
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callCreateAudienceList
();
checkCreateReportTaskProgress(name)
checkCreateReportTaskProgress
(
name
:
string
)
:
Promise<LROperation<protos
.
google
.
analytics
.
data
.
v1alpha
.
ReportTask
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
ReportTaskMetadata
>> ;
Check the status of the long running operation returned by createReportTask()
.
name
string
The operation name that will be passed.
Promise
< LROperation
< protos.google.analytics.data.v1alpha.ReportTask
, protos.google.analytics.data.v1alpha.ReportTaskMetadata
>>
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource where this report task will be created.
* Format: `properties/{propertyId}`
*/
// const parent = 'abc123'
/**
* Required. The report task configuration to create.
*/
// const reportTask = {}
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callCreateReportTask
()
{
// Construct request
const
request
=
{
parent
,
reportTask
,
};
// Run request
const
[
operation
]
=
await
dataClient
.
createReportTask
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callCreateReportTask
();
close()
close
()
:
Promise<void>
;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Promise
<void>
{Promise} A promise that resolves when the client is closed.
createAudienceList(request, options)
createAudienceList
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateAudienceListRequest
,
options
?:
CallOptions
)
:
Promise
< [
LROperation<protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceListMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
undefined
,
{}
|
undefined
]>;
Creates an audience list for later retrieval. This method quickly returns the audience list's resource name and initiates a long running asynchronous request to form an audience list. To list the users in an audience list, first create the audience list through this method and then send the audience resource name to the QueryAudienceList
method.
See [Creating an Audience List]( https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics ) for an introduction to Audience Lists with examples.
An audience list is a snapshot of the users currently in the audience at the time of audience list creation. Creating audience lists for one audience on different days will return different results as users enter and exit the audience.
Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572 . Audience lists contain the users in each audience.
This method is available at beta stability at [audienceExports.create]( https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/create ). To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback]( https://forms.gle/EeA5u5LW6PEggtCEA ) form.
request
options
Promise
<[ LROperation
< protos.google.analytics.data.v1alpha.IAudienceList
, protos.google.analytics.data.v1alpha.IAudienceListMetadata
>, protos.google.longrunning.IOperation
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise()
method returns a promise you can await
for. Please see the documentation
for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource where this audience list will be created.
* Format: `properties/{property}`
*/
// const parent = 'abc123'
/**
* Required. The audience list to create.
*/
// const audienceList = {}
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callCreateAudienceList
()
{
// Construct request
const
request
=
{
parent
,
audienceList
,
};
// Run request
const
[
operation
]
=
await
dataClient
.
createAudienceList
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callCreateAudienceList
();
createAudienceList(request, options, callback)
createAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateAudienceListRequest
,
options
:
CallOptions
,
callback
:
Callback<LROperation<protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceListMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< LROperation
< protos.google.analytics.data.v1alpha.IAudienceList
, protos.google.analytics.data.v1alpha.IAudienceListMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
createAudienceList(request, callback)
createAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateAudienceListRequest
,
callback
:
Callback<LROperation<protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceListMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< LROperation
< protos.google.analytics.data.v1alpha.IAudienceList
, protos.google.analytics.data.v1alpha.IAudienceListMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
createRecurringAudienceList(request, options)
createRecurringAudienceList
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateRecurringAudienceListRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
,
(
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateRecurringAudienceListRequest
|
undefined
),
{}
|
undefined
]>;
Creates a recurring audience list. Recurring audience lists produces new audience lists each day. Audience lists are users in an audience at the time of the list's creation.
A recurring audience list ensures that you have audience list based on the most recent data available for use each day. If you manually create audience list, you don't know when an audience list based on an additional day's data is available. This recurring audience list automates the creation of an audience list when an additional day's data is available. You will consume fewer quota tokens by using recurring audience list versus manually creating audience list at various times of day trying to guess when an additional day's data is ready.
This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback]( https://forms.gle/EeA5u5LW6PEggtCEA ) form.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IRecurringAudienceList
,
( protos.google.analytics.data.v1alpha.ICreateRecurringAudienceListRequest
| undefined),
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing RecurringAudienceList . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource where this recurring audience list will be
* created. Format: `properties/{property}`
*/
// const parent = 'abc123'
/**
* Required. The recurring audience list to create.
*/
// const recurringAudienceList = {}
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callCreateRecurringAudienceList
()
{
// Construct request
const
request
=
{
parent
,
recurringAudienceList
,
};
// Run request
const
response
=
await
dataClient
.
createRecurringAudienceList
(
request
);
console
.
log
(
response
);
}
callCreateRecurringAudienceList
();
createRecurringAudienceList(request, options, callback)
createRecurringAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateRecurringAudienceListRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateRecurringAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.IRecurringAudienceList
, protos.google.analytics.data.v1alpha.ICreateRecurringAudienceListRequest
| null | undefined, {} | null | undefined>
void
createRecurringAudienceList(request, callback)
createRecurringAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateRecurringAudienceListRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateRecurringAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
callback
Callback
< protos.google.analytics.data.v1alpha.IRecurringAudienceList
, protos.google.analytics.data.v1alpha.ICreateRecurringAudienceListRequest
| null | undefined, {} | null | undefined>
void
createReportTask(request, options)
createReportTask
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateReportTaskRequest
,
options
?:
CallOptions
)
:
Promise
< [
LROperation<protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTaskMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
undefined
,
{}
|
undefined
]>;
Initiates the creation of a report task. This method quickly returns a report task and initiates a long running asynchronous request to form a customized report of your Google Analytics event data.
A report task will be retained and available for querying for 72 hours after it has been created.
A report task created by one user can be listed and queried by all users who have access to the property.
request
options
Promise
<[ LROperation
< protos.google.analytics.data.v1alpha.IReportTask
, protos.google.analytics.data.v1alpha.IReportTaskMetadata
>, protos.google.longrunning.IOperation
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise()
method returns a promise you can await
for. Please see the documentation
for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource where this report task will be created.
* Format: `properties/{propertyId}`
*/
// const parent = 'abc123'
/**
* Required. The report task configuration to create.
*/
// const reportTask = {}
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callCreateReportTask
()
{
// Construct request
const
request
=
{
parent
,
reportTask
,
};
// Run request
const
[
operation
]
=
await
dataClient
.
createReportTask
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callCreateReportTask
();
createReportTask(request, options, callback)
createReportTask
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateReportTaskRequest
,
options
:
CallOptions
,
callback
:
Callback<LROperation<protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTaskMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< LROperation
< protos.google.analytics.data.v1alpha.IReportTask
, protos.google.analytics.data.v1alpha.IReportTaskMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
createReportTask(request, callback)
createReportTask
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ICreateReportTaskRequest
,
callback
:
Callback<LROperation<protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTaskMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< LROperation
< protos.google.analytics.data.v1alpha.IReportTask
, protos.google.analytics.data.v1alpha.IReportTaskMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
deleteOperation(request, options, callback)
deleteOperation
(
request
:
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
options
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
{}
|
null
|
undefined
> ,
callback
?:
Callback<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
{}
|
null
|
undefined
> )
:
Promise<protos
.
google
.
protobuf
.
Empty
> ;
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
request
options
CallOptions
| Callback
< protos.google.protobuf.Empty
, protos.google.longrunning.DeleteOperationRequest
, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
callback
Callback
< protos.google.protobuf.Empty
, protos.google.longrunning.DeleteOperationRequest
, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
const
client
=
longrunning
.
operationsClient
();
await
client
.
deleteOperation
({
name
:
''
});
getAudienceList(request, options)
getAudienceList
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetAudienceListRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetAudienceListRequest
|
undefined
,
{}
|
undefined
]>;
Gets configuration metadata about a specific audience list. This method can be used to understand an audience list after it has been created.
See [Creating an Audience List]( https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics ) for an introduction to Audience Lists with examples.
This method is available at beta stability at [audienceExports.get]( https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/get ). To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback]( https://forms.gle/EeA5u5LW6PEggtCEA ) form.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IAudienceList
, protos.google.analytics.data.v1alpha.IGetAudienceListRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The audience list resource name.
* Format: `properties/{property}/audienceLists/{audience_list}`
*/
// const name = 'abc123'
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callGetAudienceList
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
dataClient
.
getAudienceList
(
request
);
console
.
log
(
response
);
}
callGetAudienceList
();
getAudienceList(request, options, callback)
getAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetAudienceListRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.IAudienceList
, protos.google.analytics.data.v1alpha.IGetAudienceListRequest
| null | undefined, {} | null | undefined>
void
getAudienceList(request, callback)
getAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetAudienceListRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.analytics.data.v1alpha.IAudienceList
, protos.google.analytics.data.v1alpha.IGetAudienceListRequest
| null | undefined, {} | null | undefined>
void
getOperation(request, options, callback)
getOperation
(
request
:
protos
.
google
.
longrunning
.
GetOperationRequest
,
options
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
longrunning
.
Operation
,
protos
.
google
.
longrunning
.
GetOperationRequest
,
{}
|
null
|
undefined
> ,
callback
?:
Callback<protos
.
google
.
longrunning
.
Operation
,
protos
.
google
.
longrunning
.
GetOperationRequest
,
{}
|
null
|
undefined
> )
:
Promise
< [
protos
.
google
.
longrunning
.
Operation
]>;
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
request
options
CallOptions
| Callback
< protos.google.longrunning.Operation
, protos.google.longrunning.GetOperationRequest
, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
callback
Callback
< protos.google.longrunning.Operation
, protos.google.longrunning.GetOperationRequest
, {} | null | undefined>
The function which will be called with the result of the API call.
The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.
const
client
=
longrunning
.
operationsClient
();
const
name
=
''
;
const
[
response
]
=
await
client
.
getOperation
({
name
});
// doThingsWith(response)
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
void
getPropertyQuotasSnapshot(request, options)
getPropertyQuotasSnapshot
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetPropertyQuotasSnapshotRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IPropertyQuotasSnapshot
,
(
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetPropertyQuotasSnapshotRequest
|
undefined
),
{}
|
undefined
]>;
Get all property quotas organized by quota category for a given property. This will charge 1 property quota from the category with the most quota.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IPropertyQuotasSnapshot
,
( protos.google.analytics.data.v1alpha.IGetPropertyQuotasSnapshotRequest
| undefined),
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing PropertyQuotasSnapshot . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Quotas from this property will be listed in the response.
* Format: `properties/{property}/propertyQuotasSnapshot`
*/
// const name = 'abc123'
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callGetPropertyQuotasSnapshot
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
dataClient
.
getPropertyQuotasSnapshot
(
request
);
console
.
log
(
response
);
}
callGetPropertyQuotasSnapshot
();
getPropertyQuotasSnapshot(request, options, callback)
getPropertyQuotasSnapshot
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetPropertyQuotasSnapshotRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IPropertyQuotasSnapshot
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetPropertyQuotasSnapshotRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.IPropertyQuotasSnapshot
, protos.google.analytics.data.v1alpha.IGetPropertyQuotasSnapshotRequest
| null | undefined, {} | null | undefined>
void
getPropertyQuotasSnapshot(request, callback)
getPropertyQuotasSnapshot
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetPropertyQuotasSnapshotRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IPropertyQuotasSnapshot
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetPropertyQuotasSnapshotRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
callback
Callback
< protos.google.analytics.data.v1alpha.IPropertyQuotasSnapshot
, protos.google.analytics.data.v1alpha.IGetPropertyQuotasSnapshotRequest
| null | undefined, {} | null | undefined>
void
getRecurringAudienceList(request, options)
getRecurringAudienceList
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetRecurringAudienceListRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
,
(
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetRecurringAudienceListRequest
|
undefined
),
{}
|
undefined
]>;
Gets configuration metadata about a specific recurring audience list. This method can be used to understand a recurring audience list's state after it has been created. For example, a recurring audience list resource will generate audience list instances for each day, and this method can be used to get the resource name of the most recent audience list instance.
This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback]( https://forms.gle/EeA5u5LW6PEggtCEA ) form.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IRecurringAudienceList
,
( protos.google.analytics.data.v1alpha.IGetRecurringAudienceListRequest
| undefined),
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing RecurringAudienceList . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The recurring audience list resource name.
* Format:
* `properties/{property}/recurringAudienceLists/{recurring_audience_list}`
*/
// const name = 'abc123'
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callGetRecurringAudienceList
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
dataClient
.
getRecurringAudienceList
(
request
);
console
.
log
(
response
);
}
callGetRecurringAudienceList
();
getRecurringAudienceList(request, options, callback)
getRecurringAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetRecurringAudienceListRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetRecurringAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.IRecurringAudienceList
, protos.google.analytics.data.v1alpha.IGetRecurringAudienceListRequest
| null | undefined, {} | null | undefined>
void
getRecurringAudienceList(request, callback)
getRecurringAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetRecurringAudienceListRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetRecurringAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.analytics.data.v1alpha.IRecurringAudienceList
, protos.google.analytics.data.v1alpha.IGetRecurringAudienceListRequest
| null | undefined, {} | null | undefined>
void
getReportTask(request, options)
getReportTask
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetReportTaskRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetReportTaskRequest
|
undefined
,
{}
|
undefined
]>;
Gets report metadata about a specific report task. After creating a report task, use this method to check its processing state or inspect its report definition.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IReportTask
, protos.google.analytics.data.v1alpha.IGetReportTaskRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The report task resource name.
* Format: `properties/{property}/reportTasks/{report_task}`
*/
// const name = 'abc123'
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callGetReportTask
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
dataClient
.
getReportTask
(
request
);
console
.
log
(
response
);
}
callGetReportTask
();
getReportTask(request, options, callback)
getReportTask
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetReportTaskRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetReportTaskRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.IReportTask
, protos.google.analytics.data.v1alpha.IGetReportTaskRequest
| null | undefined, {} | null | undefined>
void
getReportTask(request, callback)
getReportTask
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetReportTaskRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IGetReportTaskRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.analytics.data.v1alpha.IReportTask
, protos.google.analytics.data.v1alpha.IGetReportTaskRequest
| null | undefined, {} | null | undefined>
void
initialize()
initialize
()
:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Promise
<{
[name: string]: Function
;
}>
{Promise} A promise that resolves to an authenticated service stub.
listAudienceLists(request, options)
listAudienceLists
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
[],
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsRequest
|
null
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsResponse
]>;
Lists all audience lists for a property. This method can be used for you to find and reuse existing audience lists rather than creating unnecessary new audience lists. The same audience can have multiple audience lists that represent the list of users that were in an audience on different days.
See [Creating an Audience List]( https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics ) for an introduction to Audience Lists with examples.
This method is available at beta stability at [audienceExports.list]( https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/list ). To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback]( https://forms.gle/EeA5u5LW6PEggtCEA ) form.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IAudienceList
[], protos.google.analytics.data.v1alpha.IListAudienceListsRequest
| null, protos.google.analytics.data.v1alpha.IListAudienceListsResponse
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listAudienceListsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listAudienceLists(request, options, callback)
listAudienceLists
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsRequest
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsResponse
|
null
|
undefined
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
> )
:
void
;
request
options
CallOptions
callback
PaginationCallback
< protos.google.analytics.data.v1alpha.IListAudienceListsRequest
, protos.google.analytics.data.v1alpha.IListAudienceListsResponse
| null | undefined, protos.google.analytics.data.v1alpha.IAudienceList
>
void
listAudienceLists(request, callback)
listAudienceLists
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsRequest
,
callback
:
PaginationCallback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsRequest
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsResponse
|
null
|
undefined
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
> )
:
void
;
request
callback
PaginationCallback
< protos.google.analytics.data.v1alpha.IListAudienceListsRequest
, protos.google.analytics.data.v1alpha.IListAudienceListsResponse
| null | undefined, protos.google.analytics.data.v1alpha.IAudienceList
>
void
listAudienceListsAsync(request, options)
listAudienceListsAsync
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
analytics
.
data
.
v1alpha
.
IAudienceList
> ;
Equivalent to listAudienceLists
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
options
AsyncIterable
< protos.google.analytics.data.v1alpha.IAudienceList
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. All audience lists for this property will be listed in the
* response. Format: `properties/{property}`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of audience lists to return. The service may
* return fewer than this value. If unspecified, at most 200 audience lists
* will be returned. The maximum value is 1000 (higher values will be coerced
* to the maximum).
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListAudienceLists` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListAudienceLists` must
* match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callListAudienceLists
()
{
// Construct request
const
request
=
{
parent
,
};
// Run request
const
iterable
=
dataClient
.
listAudienceListsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
console
.
log
(
response
);
}
}
callListAudienceLists
();
listAudienceListsStream(request, options)
listAudienceListsStream
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListAudienceListsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
request
options
Transform
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listAudienceListsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listOperationsAsync(request, options)
listOperationsAsync
(
request
:
protos
.
google
.
longrunning
.
ListOperationsRequest
,
options
?:
gax
.
CallOptions
)
:
AsyncIterable<protos
.
google
.
longrunning
.
ListOperationsResponse
> ;
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED
. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
request
options
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
AsyncIterable
< protos.google.longrunning.ListOperationsResponse
>
{Object} An iterable Object that conforms to iteration protocols .
const
client
=
longrunning
.
operationsClient
();
for
await
(
const
response
of
client
.
listOperationsAsync
(
request
));
// doThingsWith(response)
listRecurringAudienceLists(request, options)
listRecurringAudienceLists
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
[],
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsRequest
|
null
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsResponse
]>;
Lists all recurring audience lists for a property. This method can be used for you to find and reuse existing recurring audience lists rather than creating unnecessary new recurring audience lists. The same audience can have multiple recurring audience lists that represent different dimension combinations; for example, just the dimension deviceId
or both the dimensions deviceId
and userId
.
This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback]( https://forms.gle/EeA5u5LW6PEggtCEA ) form.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IRecurringAudienceList
[], protos.google.analytics.data.v1alpha.IListRecurringAudienceListsRequest
| null, protos.google.analytics.data.v1alpha.IListRecurringAudienceListsResponse
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of RecurringAudienceList
. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listRecurringAudienceListsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listRecurringAudienceLists(request, options, callback)
listRecurringAudienceLists
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsRequest
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsResponse
|
null
|
undefined
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
> )
:
void
;
options
CallOptions
callback
void
listRecurringAudienceLists(request, callback)
listRecurringAudienceLists
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsRequest
,
callback
:
PaginationCallback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsRequest
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsResponse
|
null
|
undefined
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
> )
:
void
;
callback
void
listRecurringAudienceListsAsync(request, options)
listRecurringAudienceListsAsync
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
analytics
.
data
.
v1alpha
.
IRecurringAudienceList
> ;
Equivalent to listRecurringAudienceLists
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
options
AsyncIterable
< protos.google.analytics.data.v1alpha.IRecurringAudienceList
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing RecurringAudienceList . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. All recurring audience lists for this property will be listed in
* the response. Format: `properties/{property}`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of recurring audience lists to return. The
* service may return fewer than this value. If unspecified, at most 200
* recurring audience lists will be returned. The maximum value is 1000
* (higher values will be coerced to the maximum).
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous
* `ListRecurringAudienceLists` call. Provide this to retrieve the subsequent
* page.
* When paginating, all other parameters provided to
* `ListRecurringAudienceLists` must match the call that provided the page
* token.
*/
// const pageToken = 'abc123'
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callListRecurringAudienceLists
()
{
// Construct request
const
request
=
{
parent
,
};
// Run request
const
iterable
=
dataClient
.
listRecurringAudienceListsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
console
.
log
(
response
);
}
}
callListRecurringAudienceLists
();
listRecurringAudienceListsStream(request, options)
listRecurringAudienceListsStream
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListRecurringAudienceListsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
request
options
Transform
{Stream} An object stream which emits an object representing RecurringAudienceList
on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listRecurringAudienceListsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listReportTasks(request, options)
listReportTasks
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
[],
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksRequest
|
null
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksResponse
]>;
Lists all report tasks for a property.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IReportTask
[], protos.google.analytics.data.v1alpha.IListReportTasksRequest
| null, protos.google.analytics.data.v1alpha.IListReportTasksResponse
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listReportTasksAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listReportTasks(request, options, callback)
listReportTasks
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksRequest
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksResponse
|
null
|
undefined
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
> )
:
void
;
request
options
CallOptions
callback
PaginationCallback
< protos.google.analytics.data.v1alpha.IListReportTasksRequest
, protos.google.analytics.data.v1alpha.IListReportTasksResponse
| null | undefined, protos.google.analytics.data.v1alpha.IReportTask
>
void
listReportTasks(request, callback)
listReportTasks
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksRequest
,
callback
:
PaginationCallback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksRequest
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksResponse
|
null
|
undefined
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
> )
:
void
;
request
callback
PaginationCallback
< protos.google.analytics.data.v1alpha.IListReportTasksRequest
, protos.google.analytics.data.v1alpha.IListReportTasksResponse
| null | undefined, protos.google.analytics.data.v1alpha.IReportTask
>
void
listReportTasksAsync(request, options)
listReportTasksAsync
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
analytics
.
data
.
v1alpha
.
IReportTask
> ;
Equivalent to listReportTasks
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
options
AsyncIterable
< protos.google.analytics.data.v1alpha.IReportTask
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. All report tasks for this property will be listed in the
* response. Format: `properties/{property}`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of report tasks to return.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListReportTasks` call.
* Provide this to retrieve the subsequent page.
*/
// const pageToken = 'abc123'
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callListReportTasks
()
{
// Construct request
const
request
=
{
parent
,
};
// Run request
const
iterable
=
dataClient
.
listReportTasksAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
console
.
log
(
response
);
}
}
callListReportTasks
();
listReportTasksStream(request, options)
listReportTasksStream
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IListReportTasksRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
request
options
Transform
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listReportTasksAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
matchAudienceListFromAudienceListName(audienceListName)
matchAudienceListFromAudienceListName
(
audienceListName
:
string
)
:
string
|
number
;
Parse the audience_list from AudienceList resource.
audienceListName
string
A fully-qualified path representing AudienceList resource.
string | number
{string} A string representing the audience_list.
matchPropertyFromAudienceListName(audienceListName)
matchPropertyFromAudienceListName
(
audienceListName
:
string
)
:
string
|
number
;
Parse the property from AudienceList resource.
audienceListName
string
A fully-qualified path representing AudienceList resource.
string | number
{string} A string representing the property.
matchPropertyFromPropertyName(propertyName)
matchPropertyFromPropertyName
(
propertyName
:
string
)
:
string
|
number
;
Parse the property from Property resource.
propertyName
string
A fully-qualified path representing Property resource.
string | number
{string} A string representing the property.
matchPropertyFromPropertyQuotasSnapshotName(propertyQuotasSnapshotName)
matchPropertyFromPropertyQuotasSnapshotName
(
propertyQuotasSnapshotName
:
string
)
:
string
|
number
;
Parse the property from PropertyQuotasSnapshot resource.
propertyQuotasSnapshotName
string
A fully-qualified path representing PropertyQuotasSnapshot resource.
string | number
{string} A string representing the property.
matchPropertyFromRecurringAudienceListName(recurringAudienceListName)
matchPropertyFromRecurringAudienceListName
(
recurringAudienceListName
:
string
)
:
string
|
number
;
Parse the property from RecurringAudienceList resource.
recurringAudienceListName
string
A fully-qualified path representing RecurringAudienceList resource.
string | number
{string} A string representing the property.
matchPropertyFromReportTaskName(reportTaskName)
matchPropertyFromReportTaskName
(
reportTaskName
:
string
)
:
string
|
number
;
Parse the property from ReportTask resource.
reportTaskName
string
A fully-qualified path representing ReportTask resource.
string | number
{string} A string representing the property.
matchRecurringAudienceListFromRecurringAudienceListName(recurringAudienceListName)
matchRecurringAudienceListFromRecurringAudienceListName
(
recurringAudienceListName
:
string
)
:
string
|
number
;
Parse the recurring_audience_list from RecurringAudienceList resource.
recurringAudienceListName
string
A fully-qualified path representing RecurringAudienceList resource.
string | number
{string} A string representing the recurring_audience_list.
matchReportTaskFromReportTaskName(reportTaskName)
matchReportTaskFromReportTaskName
(
reportTaskName
:
string
)
:
string
|
number
;
Parse the report_task from ReportTask resource.
reportTaskName
string
A fully-qualified path representing ReportTask resource.
string | number
{string} A string representing the report_task.
propertyPath(property)
propertyPath
(
property
:
string
)
:
string
;
Return a fully-qualified property resource name string.
property
string
string
{string} Resource name string.
propertyQuotasSnapshotPath(property)
propertyQuotasSnapshotPath
(
property
:
string
)
:
string
;
Return a fully-qualified propertyQuotasSnapshot resource name string.
property
string
string
{string} Resource name string.
queryAudienceList(request, options)
queryAudienceList
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListResponse
,
(
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListRequest
|
undefined
),
{}
|
undefined
]>;
Retrieves an audience list of users. After creating an audience, the users are not immediately available for listing. First, a request to CreateAudienceList
is necessary to create an audience list of users, and then second, this method is used to retrieve the users in the audience list.
See [Creating an Audience List]( https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics ) for an introduction to Audience Lists with examples.
Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572 .
This method is available at beta stability at [audienceExports.query]( https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/query ). To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback]( https://forms.gle/EeA5u5LW6PEggtCEA ) form.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IQueryAudienceListResponse
,
( protos.google.analytics.data.v1alpha.IQueryAudienceListRequest
| undefined),
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing QueryAudienceListResponse . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the audience list to retrieve users from.
* Format: `properties/{property}/audienceLists/{audience_list}`
*/
// const name = 'abc123'
/**
* Optional. The row count of the start row. The first row is counted as row
* 0.
* When paging, the first request does not specify offset; or equivalently,
* sets offset to 0; the first request returns the first `limit` of rows. The
* second request sets offset to the `limit` of the first request; the second
* request returns the second `limit` of rows.
* To learn more about this pagination parameter, see
* Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
*/
// const offset = 1234
/**
* Optional. The number of rows to return. If unspecified, 10,000 rows are
* returned. The API returns a maximum of 250,000 rows per request, no matter
* how many you ask for. `limit` must be positive.
* The API can also return fewer rows than the requested `limit`, if there
* aren't as many dimension values as the `limit`.
* To learn more about this pagination parameter, see
* Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
*/
// const limit = 1234
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callQueryAudienceList
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
dataClient
.
queryAudienceList
(
request
);
console
.
log
(
response
);
}
callQueryAudienceList
();
queryAudienceList(request, options, callback)
queryAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.IQueryAudienceListResponse
, protos.google.analytics.data.v1alpha.IQueryAudienceListRequest
| null | undefined, {} | null | undefined>
void
queryAudienceList(request, callback)
queryAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.analytics.data.v1alpha.IQueryAudienceListResponse
, protos.google.analytics.data.v1alpha.IQueryAudienceListRequest
| null | undefined, {} | null | undefined>
void
queryReportTask(request, options)
queryReportTask
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskRequest
|
undefined
,
{}
|
undefined
]>;
Retrieves a report task's content. After requesting the CreateReportTask
, you are able to retrieve the report content once the report is ACTIVE. This method will return an error if the report task's state is not ACTIVE
. A query response will return the tabular row & column values of the report.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IQueryReportTaskResponse
, protos.google.analytics.data.v1alpha.IQueryReportTaskRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing QueryReportTaskResponse . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The report source name.
* Format: `properties/{property}/reportTasks/{report}`
*/
// const name = 'abc123'
/**
* Optional. The row count of the start row in the report. The first row is
* counted as row 0.
* When paging, the first request does not specify offset; or equivalently,
* sets offset to 0; the first request returns the first `limit` of rows. The
* second request sets offset to the `limit` of the first request; the second
* request returns the second `limit` of rows.
* To learn more about this pagination parameter, see
* Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
*/
// const offset = 1234
/**
* Optional. The number of rows to return from the report. If unspecified,
* 10,000 rows are returned. The API returns a maximum of 250,000 rows per
* request, no matter how many you ask for. `limit` must be positive.
* The API can also return fewer rows than the requested `limit`, if there
* aren't as many dimension values as the `limit`. The number of rows
* available to a QueryReportTaskRequest is further limited by the limit of
* the associated ReportTask. A query can retrieve at most ReportTask.limit
* rows. For example, if the ReportTask has a limit of 1,000, then a
* QueryReportTask request with offset=900 and limit=500 will return at most
* 100 rows.
* To learn more about this pagination parameter, see
* Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
*/
// const limit = 1234
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callQueryReportTask
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
dataClient
.
queryReportTask
(
request
);
console
.
log
(
response
);
}
callQueryReportTask
();
queryReportTask(request, options, callback)
queryReportTask
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.IQueryReportTaskResponse
, protos.google.analytics.data.v1alpha.IQueryReportTaskRequest
| null | undefined, {} | null | undefined>
void
queryReportTask(request, callback)
queryReportTask
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IQueryReportTaskRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.analytics.data.v1alpha.IQueryReportTaskResponse
, protos.google.analytics.data.v1alpha.IQueryReportTaskRequest
| null | undefined, {} | null | undefined>
void
recurringAudienceListPath(property, recurringAudienceList)
recurringAudienceListPath
(
property
:
string
,
recurringAudienceList
:
string
)
:
string
;
Return a fully-qualified recurringAudienceList resource name string.
property
string
recurringAudienceList
string
string
{string} Resource name string.
reportTaskPath(property, reportTask)
reportTaskPath
(
property
:
string
,
reportTask
:
string
)
:
string
;
Return a fully-qualified reportTask resource name string.
property
string
reportTask
string
string
{string} Resource name string.
runFunnelReport(request, options)
runFunnelReport
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportRequest
|
undefined
,
{}
|
undefined
]>;
Returns a customized funnel report of your Google Analytics event data. The data returned from the API is as a table with columns for the requested dimensions and metrics.
Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step. For example, how do prospects become shoppers and then become buyers? How do one time buyers become repeat buyers? With this information, you can improve inefficient or abandoned customer journeys. To learn more, see [GA4 Funnel Explorations]( https://support.google.com/analytics/answer/9327974 ).
This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the [Google Analytics Data API Funnel Reporting Feedback](https://docs.google.com/forms/d/e/1FAIpQLSdwOlQDJAUoBiIgUZZ3S_Lwi8gr7Bb0k1jhvc-DEg7Rol3UjA/viewform).
request
options
Promise
<[ protos.google.analytics.data.v1alpha.IRunFunnelReportResponse
, protos.google.analytics.data.v1alpha.IRunFunnelReportRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing RunFunnelReportResponse . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Optional. A Google Analytics property identifier whose events are tracked.
* Specified in the URL path and not the body. To learn more, see where to
* find your Property
* ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
* Within a batch request, this property should either be unspecified or
* consistent with the batch-level property.
* Example: properties/1234
*/
// const property = 'abc123'
/**
* Optional. Date ranges of data to read. If multiple date ranges are
* requested, each response row will contain a zero based date range index. If
* two date ranges overlap, the event data for the overlapping days is
* included in the response rows for both date ranges.
*/
// const dateRanges = [1,2,3,4]
/**
* Optional. The configuration of this request's funnel. This funnel
* configuration is required.
*/
// const funnel = {}
/**
* Optional. If specified, this breakdown adds a dimension to the funnel table
* sub report response. This breakdown dimension expands each funnel step to
* the unique values of the breakdown dimension. For example, a breakdown by
* the `deviceCategory` dimension will create rows for `mobile`, `tablet`,
* `desktop`, and the total.
*/
// const funnelBreakdown = {}
/**
* Optional. If specified, next action adds a dimension to the funnel
* visualization sub report response. This next action dimension expands each
* funnel step to the unique values of the next action. For example a next
* action of the `eventName` dimension will create rows for several events
* (for example `session_start` & `click`) and the total.
* Next action only supports `eventName` and most Page / Screen dimensions
* like `pageTitle` and `pagePath`.
*/
// const funnelNextAction = {}
/**
* Optional. The funnel visualization type controls the dimensions present in
* the funnel visualization sub report response. If not specified,
* `STANDARD_FUNNEL` is used.
*/
// const funnelVisualizationType = {}
/**
* Optional. The configurations of segments. Segments are subsets of a
* property's data. In a funnel report with segments, the funnel is evaluated
* in each segment.
* Each segment specified in this request
* produces a separate row in the response; in the response, each segment
* identified by its name.
* The segments parameter is optional. Requests are limited to 4 segments.
*/
// const segments = [1,2,3,4]
/**
* Optional. The number of rows to return. If unspecified, 10,000 rows are
* returned. The API returns a maximum of 250,000 rows per request, no matter
* how many you ask for. `limit` must be positive.
* The API can also return fewer rows than the requested `limit`, if there
* aren't as many dimension values as the `limit`.
*/
// const limit = 1234
/**
* Optional. Dimension filters allow you to ask for only specific dimension
* values in the report. To learn more, see Creating a Report: Dimension
* Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters)
* for examples. Metrics cannot be used in this filter.
*/
// const dimensionFilter = {}
/**
* Optional. Toggles whether to return the current state of this Analytics
* Property's quota. Quota is returned in PropertyQuota (#PropertyQuota).
*/
// const returnPropertyQuota = true
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callRunFunnelReport
()
{
// Construct request
const
request
=
{
};
// Run request
const
response
=
await
dataClient
.
runFunnelReport
(
request
);
console
.
log
(
response
);
}
callRunFunnelReport
();
runFunnelReport(request, options, callback)
runFunnelReport
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.IRunFunnelReportResponse
, protos.google.analytics.data.v1alpha.IRunFunnelReportRequest
| null | undefined, {} | null | undefined>
void
runFunnelReport(request, callback)
runFunnelReport
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
IRunFunnelReportRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.analytics.data.v1alpha.IRunFunnelReportResponse
, protos.google.analytics.data.v1alpha.IRunFunnelReportRequest
| null | undefined, {} | null | undefined>
void
sheetExportAudienceList(request, options)
sheetExportAudienceList
(
request
?:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListResponse
,
(
protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListRequest
|
undefined
),
{}
|
undefined
]>;
Exports an audience list of users to a Google Sheet. After creating an audience, the users are not immediately available for listing. First, a request to CreateAudienceList
is necessary to create an audience list of users, and then second, this method is used to export those users in the audience list to a Google Sheet.
See [Creating an Audience List]( https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics ) for an introduction to Audience Lists with examples.
Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572 .
This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback]( https://forms.gle/EeA5u5LW6PEggtCEA ) form.
request
options
Promise
<[ protos.google.analytics.data.v1alpha.ISheetExportAudienceListResponse
,
( protos.google.analytics.data.v1alpha.ISheetExportAudienceListRequest
| undefined),
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing SheetExportAudienceListResponse . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the audience list to retrieve users from.
* Format: `properties/{property}/audienceLists/{audience_list}`
*/
// const name = 'abc123'
/**
* Optional. The row count of the start row. The first row is counted as row
* 0.
* When paging, the first request does not specify offset; or equivalently,
* sets offset to 0; the first request returns the first `limit` of rows. The
* second request sets offset to the `limit` of the first request; the second
* request returns the second `limit` of rows.
* To learn more about this pagination parameter, see
* Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
*/
// const offset = 1234
/**
* Optional. The number of rows to return. If unspecified, 10,000 rows are
* returned. The API returns a maximum of 250,000 rows per request, no matter
* how many you ask for. `limit` must be positive.
* The API can also return fewer rows than the requested `limit`, if there
* aren't as many dimension values as the `limit`.
* To learn more about this pagination parameter, see
* Pagination (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
*/
// const limit = 1234
// Imports the Data library
const
{
AlphaAnalyticsDataClient
}
=
require
(
'@google-cloud/data'
).
v1alpha
;
// Instantiates a client
const
dataClient
=
new
AlphaAnalyticsDataClient
();
async
function
callSheetExportAudienceList
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
dataClient
.
sheetExportAudienceList
(
request
);
console
.
log
(
response
);
}
callSheetExportAudienceList
();
sheetExportAudienceList(request, options, callback)
sheetExportAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.analytics.data.v1alpha.ISheetExportAudienceListResponse
, protos.google.analytics.data.v1alpha.ISheetExportAudienceListRequest
| null | undefined, {} | null | undefined>
void
sheetExportAudienceList(request, callback)
sheetExportAudienceList
(
request
:
protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListRequest
,
callback
:
Callback<protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListResponse
,
protos
.
google
.
analytics
.
data
.
v1alpha
.
ISheetExportAudienceListRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.analytics.data.v1alpha.ISheetExportAudienceListResponse
, protos.google.analytics.data.v1alpha.ISheetExportAudienceListRequest
| null | undefined, {} | null | undefined>
void