Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
建構 SegmentResponse
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
策展端點處理區隔要求中傳送的信號後,必須在 50 毫秒內建構 SegmentResponse 物件並回覆 Google,指出適用於每個曝光的資料區隔。Google 會忽略 50 毫秒後收到的回應。
您可以使用 SegmentResponse.segment.segment_id 欄位,找出與廣告商機相關的區隔 ID。您可以使用 Marketplace API 中的 dataSegments 資源,找出所建立資料區隔的 ID。詳情請參閱「如何識別 API 中的資料區隔與即時精選內容」。
如果沒有適用的資料區隔,請回應
如果發現沒有任何資料區隔適用於特定區隔要求,請省略建構 SegmentResponse 物件,並以空白 HTTP 204 狀態回應。
SegmentResponse 範例
如果 SegmentRequest 物件的內容指出曝光與資料區隔 test-data-segment-1 和 test-data-segment-2 相關,請在 SegmentResponse 物件中傳回這些區隔的 ID:
{
"segment": [
{
"segment_id": "test-data-segment-1",
},
{
"segment_id": "test-data-segment-2",
}
]
}
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-01-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2026-01-27 (世界標準時間)。"],[],[]]