Method: properties.audienceLists.exportSheet

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

string

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

Request body

The request body contains data with the following structure:

JSON representation
{
  "offset": string,
  "limit": string
}
Fields
offset

string (int64 format)

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.

limit

string (int64 format)

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.

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 (AudienceList)
  }
}
Fields
spreadsheetUri

string

A uri for you to visit in your browser to view the Google Sheet.

spreadsheetId

string

An ID that identifies the created Google Sheet resource.

rowCount

integer

The total number of rows in the AudienceList result. rowCount is independent of the number of rows returned in the response, the limit request parameter, and the offset request parameter. For example if a query returns 175 rows and includes limit of 50 in the API request, the response will contain rowCount of 175 but only 50 rows.

To learn more about this pagination parameter, see Pagination.

audienceList

object (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 offset value to retrieve the next page of rows in an additional Google Sheet.

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