試用 Google Analytics 的 MCP 伺服器。從
GitHub 安裝,詳情請參閱
公告。
週期性目標對象名單
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本文將說明 Google Analytics Data API 第 1 版的進階功能:重複目標對象清單。如要瞭解目標對象名單匯出功能,請參閱目標對象匯出功能基礎指南。
定期目標對象名單會在目標對象會員變更時每天產生目標對象名單,確保您使用的是最新資料。
一般 (非週期性) 目標對象名單是指在名單產生時,目標對象中使用者的靜態名單。
每天建立新的目標對象名單
處理一天的目標對象資料和更新會員資格需要的時間不一定。您無法確保目標對象名單資料會在 24 小時內更新。
舉例來說,即使您每天在同一時間要求取得目標對象名單,但在某些日子,目標對象名單會與前一天相同,而在其他日子,目標對象名單會有所不同,並包含額外一天的成員變更。

目標對象名單是根據最近一次會員變更前一天的事件資料建立。如果您在每日會員更新發生前建立目標對象名單,系統會使用前兩天的資料。如果您在每日會員更新後建立目標對象名單,系統會使用昨天的資料。
定期輪詢週期性目標對象名單
只有在有額外一天的資料時,週期性目標對象名單才會產生目標對象名單。這樣一來,您就不需要再猜測何時該建立新的目標對象清單。相反地,您可以整天不間斷地輪詢「重複出現的目標對象名單」,看看是否有其他資料可用。

建立週期性目標對象名單
如要建立週期性目標對象名單,請使用要求中的 RecurringAudienceList
物件,呼叫 recurringAudienceLists.create
方法。以下是必要參數:
以下是定期目標對象名單建立要求的範例:
HTTP 要求
POST https://analyticsdata.googleapis.com/v1alpha/properties/1234567/recurringAudienceLists
{
"audience": "properties/1234567/audiences/12345",
"dimensions": [
{
"dimensionName": "deviceId"
}
]
}
recurringAudienceLists.create
方法的回應會在 name
欄位 (例如 properties/1234567/recurringAudienceLists/123
) 中包含名稱,可在後續查詢中使用,用於擷取這個週期性目標對象名單的設定中繼資料。此外,設定中繼資料還包含為這份週期性目標對象名單建立的目標對象名單例項資源名稱。
HTTP 回應
{
"name": "properties/1234567/recurringAudienceLists/123",
"audience": "properties/1234567/audiences/12345",
"audienceDisplayName": "Purchasers",
"dimensions": [
{
"dimensionName": "deviceId"
}
],
"activeDaysRemaining": 180,
"audienceLists": [
"properties/1234567/audienceLists/45678"
]
}
使用 recurringAudienceLists.get
方法,擷取特定重複目標對象名單的設定中繼資料。設定中繼資料包含為這項週期性目標對象名單建立的目標對象名單例項資源名稱。
範例如下:
HTTP 要求
GET https://analyticsdata.googleapis.com/v1alpha/properties/1234567/recurringAudienceLists/123
回應中會傳回 RecurringAudienceList
的例項。這項資源包含設定中繼資料,其中包含為這項週期性目標對象名單建立的目標對象名單例項資源名稱。
HTTP 回應
{
"name": "properties/1234567/recurringAudienceLists/123",
"audience": "properties/1234567/audiences/12345",
"audienceDisplayName": "Purchasers",
"dimensions": [
{
"dimensionName": "deviceId"
}
],
"activeDaysRemaining": 180,
"audienceLists": [
"properties/1234567/audienceLists/45678"
]
}
您可以使用 recurringAudienceLists.list
列出資源的所有週期性目標對象名單。
使用 Webhook 接收有關新目標對象名單的非同步通知
您可以使用 recurringAudienceLists.get
方法,定期輪詢特定重複目標對象名單的設定中繼資料,也可以在目標對象名單可用時,以非同步方式接收 Webhook 通知。
如要設定 Webhook 通知,請在建立新的週期性目標對象名單時,指定 webhookNotification
欄位。
如要進一步瞭解如何在 Google Analytics Data API v1 中使用 Webhook,請按照Async audience lists with webhooks
指南操作。
擷取目標對象匯出作業中的使用者
如要擷取目標對象匯出資料中的使用者,請呼叫 audienceExports.query
方法,並指定從 recurringAudienceLists.get
或 recurringAudienceLists.list
提供的設定中繼資料擷取的目標對象匯出資料名稱。
HTTP 要求
POST https://analyticsdata.googleapis.com/v1beta/properties/1234567/audienceExports/123:query
如果目標對象匯出作業已就緒,系統會傳回包含目標對象中使用者名單的回應:
HTTP 回應
{
"audienceExport": {
"name": "properties/1234567/audienceExports/123",
"audience": "properties/1234567/audiences/12345",
"audienceDisplayName": "Purchasers",
"dimensions": [
{
"dimensionName": "deviceId"
}
],
"state": "ACTIVE",
"beginCreatingTime": "2023-06-22T23:35:28.787910949Z"
},
"audienceRows": [
{
"dimensionValues": [
{
"value": "1000276123.1681742376"
}
]
},
{
"dimensionValues": [
{
"value": "1000374452.1668627377"
}
]
},
{
"dimensionValues": [
{
"value": "1000391956.1652750758"
}
]
},
{
"dimensionValues": [
{
"value": "1000410539.1682018694"
}
]
},
{
"dimensionValues": [
{
"value": "1000703969.1666725875"
}
]
}
],
"rowCount": 5
}
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eRecurring audience lists automatically update daily with audience membership changes, providing access to the most recent data.\u003c/p\u003e\n"],["\u003cp\u003eThese lists are generated based on event data from one to two days prior, depending on the timing of daily membership updates.\u003c/p\u003e\n"],["\u003cp\u003eYou can poll a recurring audience list frequently to check for data updates or utilize webhooks for asynchronous notifications about new audience lists.\u003c/p\u003e\n"],["\u003cp\u003eTo create a recurring audience list, you need to specify the audience name and desired dimensions using the \u003ccode\u003erecurringAudienceLists.create\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eRetrieving users in an audience export involves calling the \u003ccode\u003eaudienceExports.query\u003c/code\u003e method with the audience export name obtained from the recurring audience list's configuration metadata.\u003c/p\u003e\n"]]],["Recurring audience lists update daily with membership changes, unlike static, regular lists. To create one, use the `recurringAudienceLists.create` method, specifying a valid audience name and dimensions. These lists are updated when new data is available, and polling the list via `recurringAudienceLists.get` reveals if new data is present. Alternatively, webhooks can provide asynchronous notifications. Use `audienceExports.query` to retrieve users from an audience export based on the recurring audience lists.\n"],null,["# Recurring audience lists\n\nThis document describes recurring audience lists, which are an\nadvanced feature of the Google Analytics Data API v1.\nFor an introduction to the audience list export feature,\nsee the [audience export fundamentals guide](/analytics/devguides/reporting/data/v1/audience-export-basics).\n\nRecurring audience lists produce audience lists daily as\naudience memberships change, to ensure you're working with the most recent data.\n\nRegular (non-recurring) audience lists are static lists of users in the audience\nat the time the list is generated.\n\nCreate a new audience list daily\n--------------------------------\n\nIt takes a variable amount of time to process one day's audience data and update\nmembership. There's no way to be sure that the audience list data is updated in\n24 hours.\n\nFor example, even if you request an audience list at the same time each day,\non some days the audience list will be the same\nas the previous day, and on other days, the audience list will be different and\ncontain an additional day of membership changes.\n\nAudience lists are based on event data from one day before the most recent\nmembership changes. If you create an audience list before daily membership\nupdates occur, it will use data from the two days before. If you create an\naudience list after daily membership updates occur, it will use data from\nyesterday.\n\nPeriodically poll a recurring audience list\n-------------------------------------------\n\nRecurring Audience Lists only produce Audience Lists when an additional day's\ndata is available. This removes the guesswork of deciding when to create new\nAudience Lists. Instead, you can cheaply poll the Recurring Audience List\nthroughout the day to see if additional data is available.\n\nCreate a Recurring Audience List\n--------------------------------\n\nTo create a recurring audience list, call the\n[`recurringAudienceLists.create`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists/create)\nmethod using the\n[`RecurringAudienceList`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists#RecurringAudienceList)\nobject in a request. The following parameters are required:\n\n- A valid audience name in the [`audience`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists#RecurringAudienceList.FIELDS.audience) field, formatted as `properties/{propertyId}/audiences/{audienceId}`. You can use the [`audiences.list`](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.audiences/list) method of the Google Analytics Admin API v1 to obtain this value. The [`Audience.name`](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.audiences#Audience.FIELDS.name) field of the `audiences.list` response contains the audience name.\n- A valid list of dimensions in the [`dimensions`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists#RecurringAudienceList.FIELDS.dimensions) field. The list of dimensions supported by this method can be found in the [Audience Export Schema](/analytics/devguides/reporting/data/v1/audience-export-api-schema) documentation. Only the data for dimensions mentioned in this field is included in an Audience List.\n\nHere's a sample recurring audience list creation request: \n\n### HTTP Request\n\n POST https://analyticsdata.googleapis.com/v1alpha/properties/1234567/recurringAudienceLists\n {\n \"audience\": \"properties/1234567/audiences/12345\",\n \"dimensions\": [\n {\n \"dimensionName\": \"deviceId\"\n }\n ]\n }\n\nA response of the `recurringAudienceLists.create` method contains the\nname in the `name` field (such as\n`properties/1234567/recurringAudienceLists/123`), which can be used in\nsubsequent queries to retrieve the configuration metadata\nfor this recurring audience list. Also, the configuration metadata contains\n[resource names for audience list instances](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists#RecurringAudienceList.FIELDS.audience_lists)\ncreated for this recurring audience list. \n\n### HTTP Response\n\n {\n \"name\": \"properties/1234567/recurringAudienceLists/123\",\n \"audience\": \"properties/1234567/audiences/12345\",\n \"audienceDisplayName\": \"Purchasers\",\n \"dimensions\": [\n {\n \"dimensionName\": \"deviceId\"\n }\n ],\n \"activeDaysRemaining\": 180,\n \"audienceLists\": [\n \"properties/1234567/audienceLists/45678\"\n ]\n }\n\nPoll configuration metadata\n---------------------------\n\nUse the\n[`recurringAudienceLists.get`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists/get)\nmethod to retrieve configuration metadata about a specific\nrecurring audience list. The configuration metadata contains\n[resource names for audience list instances](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists#RecurringAudienceList.FIELDS.audience_lists)\ncreated for this recurring audience list.\n\nHere's an example: \n\n### HTTP Request\n\n GET https://analyticsdata.googleapis.com/v1alpha/properties/1234567/recurringAudienceLists/123\n\nAn instance of [`RecurringAudienceList`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists#RecurringAudienceList)\nis returned in response. It contains the configuration metadata, which includes\n[resource names for audience list instances](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists#RecurringAudienceList.FIELDS.audience_lists)\ncreated for this recurring audience list. \n\n### HTTP Response\n\n {\n \"name\": \"properties/1234567/recurringAudienceLists/123\",\n \"audience\": \"properties/1234567/audiences/12345\",\n \"audienceDisplayName\": \"Purchasers\",\n \"dimensions\": [\n {\n \"dimensionName\": \"deviceId\"\n }\n ],\n \"activeDaysRemaining\": 180,\n \"audienceLists\": [\n \"properties/1234567/audienceLists/45678\"\n ]\n }\n\nYou can use\n[`recurringAudienceLists.list`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists/list)\nto list all recurring audience lists for a property.\n\n### Use Webhooks to receive asynchronous notifications about new audience lists\n\nInstead of periodically polling the configuration metadata about a specific\nrecurring audience list using the\n[`recurringAudienceLists.get`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists/get)\nmethod, you can asynchronously receive Webhook notifications when an audience\nlist becomes available.\n\nTo configure Webhook notifications, specify the\n[`webhookNotification`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists#RecurringAudienceList)\nfield when creating a new recurring audience list.\n\nFollow the [`Async audience lists with webhooks`](/analytics/devguides/reporting/data/v1/audience-lists-webhooks) guide\nfor more information about using Webhooks in the Google Analytics Data API v1.\n\n### Retrieve users in an audience export\n\nTo retrieve users in an Audience Export, call the\n[`audienceExports.query`](/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/query)\nmethod and specify the Audience Export name\nretrieved from the configuration metadata provided by\n[`recurringAudienceLists.get`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists/get)\nor [`recurringAudienceLists.list`](/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.recurringAudienceLists/list). \n\n### HTTP Request\n\n POST https://analyticsdata.googleapis.com/v1beta/properties/1234567/audienceExports/123:query\n\nIf the Audience Export is ready, a response containing the list of\nusers in an audience is returned: \n\n### HTTP Response\n\n {\n \"audienceExport\": {\n \"name\": \"properties/1234567/audienceExports/123\",\n \"audience\": \"properties/1234567/audiences/12345\",\n \"audienceDisplayName\": \"Purchasers\",\n \"dimensions\": [\n {\n \"dimensionName\": \"deviceId\"\n }\n ],\n \"state\": \"ACTIVE\",\n \"beginCreatingTime\": \"2023-06-22T23:35:28.787910949Z\"\n },\n \"audienceRows\": [\n {\n \"dimensionValues\": [\n {\n \"value\": \"1000276123.1681742376\"\n }\n ]\n },\n {\n \"dimensionValues\": [\n {\n \"value\": \"1000374452.1668627377\"\n }\n ]\n },\n {\n \"dimensionValues\": [\n {\n \"value\": \"1000391956.1652750758\"\n }\n ]\n },\n {\n \"dimensionValues\": [\n {\n \"value\": \"1000410539.1682018694\"\n }\n ]\n },\n {\n \"dimensionValues\": [\n {\n \"value\": \"1000703969.1666725875\"\n }\n ]\n }\n ],\n \"rowCount\": 5\n }"]]