Google Analytics 4 Audience Exports: Ramping Up the Extensibility and Actionability of Your GA4 Audience Data

There are several significant enhancements to audience segments in Google Analytics 4 (GA4) compared to Universal Analytics.

First and foremost: no more publishing audiences one at a time to each of your linked advertising platforms (Google Ads, Display & Video 360, Search Ads 360, Google Ad Manager, Salesforce Marketing Cloud). When you link these platforms with GA4, those audiences are available for activation almost as soon as you create them and they start to populate.

The other feature with a great deal of potential is the audience export feature of GA4. One of the complaints we have heard for quite some time regarding Google Analytics behavioral data is the relative ease with which you can utilize audience data within the Google ecosystem (Google Marketing Platform and peripheral Google products) but the impossibility (or near-impossibility) of utilizing Google Analytics behavioral segments outside of the Google ecosystem without a great deal of process outside of Google Analytics.

Audience exports makes the process of using your GA4 behavioral segments and AI-based predictive segments a much easier proposition. By leveraging the Google Analytics Data API, marketers can create relatively straightforward workflows for identifying and creating audience lists that can be directly exported and queried via API. These audiences are deduplicated based on the GA4 userID dimension, and audience exports can include the following dimensions:

  • userID
  • deviceID
  • isAdsPersonalizationAllowed (true, false, not set)
  • isLimitedAdTracking (true, false, not set)

The dimensions should be a clue that audience exports is not intended, in any way shape or form, to work around privacy and consent considerations (and regulatory requirements). In other words, when you pull audience exports, respect the ads personalization and ad tracking preferences returned and treat ‘not set’ (i.e. no value returned) as though you don’t have consent if you really want to err on the side of respect for your users.

Quick Step-by-Step:

Step 1: Use the Google Analytics Admin API v1 to pull a list of audiences in your source GA4 property. This is necessary to retrieve the audience ID for the audience(s) you want to export.:

Request*:

curl \
  'https://analyticsadmin.googleapis.com/v1alpha/properties/[PROPERTY ID]/audiences?prettyPrint=true&alt=json&fields=audiences&key=[YOUR_API_KEY]' \
  --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  --header 'Accept: application/json' \
  --compressed


*Please note that all API request examples in this post use the cURL format for both simplicity and consistency throughout. As with other Google APIs, there are multiple libraries available and accompanying methods/formats for making API calls. Follow documentation and best practices relevant for your specific workflows.

Steps 2 through 4 utilize the Google Analytics Data API v1 to take the audience lists you have 

Step 3: Create an Audience Export

Request:

curl --request POST \
  'https://analyticsdata.googleapis.com/v1beta/properties/123456789/audienceExports?key=[YOUR_API_KEY]' \
  --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"audience":"properties/123456789/audiences/987654321","dimensions":[{"dimensionName":"userID"},{"dimensionName":"deviceID"},{"dimensionName":"isAdsPersonalizationAllowed"}]}' \
  --compressed


Response:

{
  "name": "operations/123456789pb4088849",
  "response": {
    "@type": "type.googleapis.com/google.analytics.data.v1beta.AudienceExport",
    "name": "properties/334700044/audienceExports/4088849",
    "audience": "properties/123456789/audiences/987654321",
    "audienceDisplayName": "Purchasers",
    "dimensions": [
      {
        "dimensionName": "userID"
      },
      {
        "dimensionName": "deviceID"
      },
      {
        "dimensionName": "isAdsPersonalizationAllowed"
      }
    ],
    "state": "CREATING",
    "beginCreatingTime": "2024-03-19T13:37:17.472140740Z",
    "rowCount": 0,
    "percentageCompleted": 0
  }
}


Wait a few minutes for the audience to fully generate. Move on to step 3.

Step 4: Query the Audience Export Readiness State:

Request:

curl \

  ‘https://analyticsdata.googleapis.com/v1beta/properties/123456789/audienceExports/4088849?key=[YOUR_API_KEY]’ \

  –header ‘Authorization: Bearer [YOUR_ACCESS_TOKEN]’ \

  –header ‘Accept: application/json’ \

  –compressed

Response:

{

  “name”: “properties/123456789/audienceExports/4088849”,

  “audience”: “properties/123456789/audiences/987654321”,

  “audienceDisplayName”: “Purchasers”,

  “dimensions”: [

    {

      “dimensionName”: “userID”

    },

    {

      “dimensionName”: “deviceID”

    },

    {

      “dimensionName”: “isAdsPersonalizationAllowed”

    }

  ],

  “state”: “ACTIVE”,

  “beginCreatingTime”: “2024-03-19T13:37:17.472140740Z”,

  “creationQuotaTokensCharged”: 585,

  “rowCount”: 761968,

  “percentageCompleted”: 100

}

Step 5: Query the audience you created to pull the list of audience members

Request:

curl --request POST \
  'https://analyticsdata.googleapis.com/v1beta/properties/334700044/audienceExports/4088849:query?key=[YOUR_API_KEY]' \
  --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"limit":10}' \
  --compressed


Response:

{
  "audienceExport": {
    "name": "properties/334700044/audienceExports/4088849",
    "audience": "properties/334700044/audiences/4103648030",
    "audienceDisplayName": "Purchasers",
    "dimensions": [
      {
        "dimensionName": "userID"
      },
      {
        "dimensionName": "deviceID"
      },
      {
        "dimensionName": "isAdsPersonalizationAllowed"
      }
    ],
    "state": "ACTIVE",
    "beginCreatingTime": "2024-03-19T13:37:17.472140740Z",
    "creationQuotaTokensCharged": 585,
    "rowCount": 761968,
    "percentageCompleted": 100
  },
  "audienceRows": [
    {
      "dimensionValues": [
        {
          "value": "(not set)"
        },
        {
          "value": "++1v87XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" (user ID obfuscated)
        },
        {
          "value": "false"
        }
      ]
    }

The response will return the audience name, reporting friendly ‘display name’, and a formatted list of all audience members along with a schema near the top of the response that shows included dimensions for each audience member.

Once you have your export ready to hand or pulled into a specific application or centralized data warehouse/lake, here are a few things to keep in mind.

  • The audience is a snapshot in time of all active members at the time you generated the list: to operationalize and activate these audiences or to use them for analysis and modeling, you need to refresh data in line with how audience membership is updated by Google and based on data freshness windows in Google Analytics 4. That works out to refreshing these audience pulls once per day as a general best practice (for pure analysis work, that time window might be much longer).
  • Due to latency and factors with how users are counted within an audience after they have met the membership criteria (i.e. not until they log at least one subsequent event/session following meeting the audience criteria), these audiences are not well-suited to real-time or near real-time use cases. When drafting requirements and workflows for pulling and utilizing these audiences, align the specifics to these limitations and considerations and focus on audiences with durable lifespans and durable intent signals versus very short time window opportunities.
  • Depending on whether you have a standard or 360 Google Analytics 4 property, you will face different audience size limits.
    • Max Returned Users: 2 million (Standard), 200 Million (GA360)
    • Max considered Users: 10 million (Standard), 1 Billion (GA360)

Try building an audience export into some of your workflows, and see what creative uses you can put your GA4 behavioral and predictive audience toward outside the Google ecosystem, too, to get more value out of these assets.

Resources:

Audience Export Documentation

Audience Export Dimensions List

Is Exporting Your Audience Important to You?

Let’s Chat Then

Patrick Soch

Patrick Soch

Related resources

If This Blog Helped You Gain More Experience, Our Newsletter Will Take You to The Next Level!

If you liked this blog and found it helpful, we send a weekly email with more in-depth content!