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 audienceLists.create
is necessary to create an audience list of users, and then second, this method is used to export those users in the audience list to a Google Sheet.
See Creating an Audience List for an introduction to Audience Lists with examples.
Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572.
This method is introduced at alpha stability with the intention of gathering feedback on syntax and capabilities before entering beta. To give your feedback on this API, complete the Google Analytics Audience Export API Feedback form.
HTTP request
POST https://analyticsdata.googleapis.com/v1alpha/{name=properties/*/audienceLists/*}:exportSheet
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The name of the audience list to retrieve users from. Format: |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "offset": string, "limit": string } |
Fields | |
---|---|
offset |
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 To learn more about this pagination parameter, see Pagination. |
limit |
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. The API can also return fewer rows than the requested To learn more about this pagination parameter, see Pagination. |
Response body
The created Google Sheet with the list of users in an audience list.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"spreadsheetUri": string,
"spreadsheetId": string,
"rowCount": integer,
"audienceList": {
object ( |
Fields | |
---|---|
spreadsheetUri |
A uri for you to visit in your browser to view the Google Sheet. |
spreadsheetId |
An ID that identifies the created Google Sheet resource. |
rowCount |
The total number of rows in the AudienceList result. To learn more about this pagination parameter, see Pagination. |
audienceList |
Configuration data about AudienceList being exported. Returned to help interpret the AudienceList in the Google Sheet of this response. For example, the AudienceList may have more rows than are present in the Google Sheet, and in that case, you may want to send an additional sheet export request with a different |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets