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.

Scopes

You will need authorization for at least one of the following scopes to make a valid call:

  • https://www.googleapis.com/auth/analytics
  • https://www.googleapis.com/auth/analytics.readonly

If unset, the scope for this method defaults to https://www.googleapis.com/auth/analytics. You can set the scope for this method like this: analyticsdata1-beta --scope <scope> properties audience-exports-create ...

Required Scalar Argument

  • <parent> (string)
    • Required. The parent resource where this audience export will be created. Format: properties/{property}

Required Request Value

The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.

For example, a structure like this:

AudienceExport:
  audience: string
  audience-display-name: string
  begin-creating-time: string
  creation-quota-tokens-charged: integer
  error-message: string
  name: string
  percentage-completed: number
  row-count: integer
  state: string

can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.

  • -r . audience=et
    • Required. The audience resource name. This resource name identifies the audience being listed and is shared between the Analytics Data & Admin APIs. Format: properties/{property}/audiences/{audience}
  • audience-display-name=magna
    • Output only. The descriptive display name for this audience. For example, "Purchasers".
  • begin-creating-time=no
    • Output only. The time when CreateAudienceExport was called and the AudienceExport began the CREATING state.
  • creation-quota-tokens-charged=46
    • Output only. The total quota tokens charged during creation of the AudienceExport. Because this token count is based on activity from the CREATING state, this tokens charged will be fixed once an AudienceExport enters the ACTIVE or FAILED states.
  • error-message=voluptua.
    • Output only. Error message is populated when an audience export fails during creation. A common reason for such a failure is quota exhaustion.
  • name=at
    • Output only. Identifier. The audience export resource name assigned during creation. This resource name identifies this AudienceExport. Format: properties/{property}/audienceExports/{audience_export}
  • percentage-completed=0.7318948296136206
    • Output only. The percentage completed for this audience export ranging between 0 to 100.
  • row-count=99
    • Output only. The total number of rows in the AudienceExport result.
  • state=takimata
    • Output only. The current state for this AudienceExport.

About Cursors

The cursor position is key to comfortably set complex nested structures. The following rules apply:

  • The cursor position is always set relative to the current one, unless the field name starts with the . character. Fields can be nested such as in -r f.s.o .
  • The cursor position is set relative to the top-level structure if it starts with ., e.g. -r .s.s
  • You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify -r struct.sub_struct=bar.
  • You can move the cursor one level up by using ... Each additional . moves it up one additional level. E.g. ... would go three levels up.

Optional Output Flags

The method's return value a JSON encoded structure, which will be written to standard output by default.

  • -o out
    • out specifies the destination to which to write the server's result to. It will be a JSON-encoded structure. The destination may be - to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.

Optional General Properties

The following properties can configure any call, and are not specific to this method.

  • -p $-xgafv=string

    • V1 error format.
  • -p access-token=string

    • OAuth access token.
  • -p alt=string

    • Data format for response.
  • -p callback=string

    • JSONP
  • -p fields=string

    • Selector specifying which fields to include in a partial response.
  • -p key=string

    • API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
  • -p oauth-token=string

    • OAuth 2.0 token for the current user.
  • -p pretty-print=boolean

    • Returns response with indentations and line breaks.
  • -p quota-user=string

    • Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
  • -p upload-type=string

    • Legacy upload protocol for media (e.g. "media", "multipart").
  • -p upload-protocol=string

    • Upload protocol for media (e.g. "raw", "multipart").