

**支援結束通知：**2026 年 10 月 30 日， AWS 將結束對 Amazon Pinpoint 的支援。2026 年 10 月 30 日之後，您將無法再存取 Amazon Pinpoint 主控台或 Amazon Pinpoint 資源 (端點、區段、行銷活動、旅程和分析)。如需詳細資訊，請參閱 [Amazon Pinpoint 終止支援](https://docs.aws.amazon.com/console/pinpoint/migration-guide)。**注意：**與 SMS、語音、行動推播、OTP 和電話號碼驗證相關的 APIs 不受此變更影響，並受 AWS 最終使用者傳訊支援。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 來自 Amazon Pinpoint 的行銷活動事件資料串流
<a name="event-streams-data-campaign"></a>

如果您使用 Amazon Pinpoint 透過管道傳送行銷活動，Amazon Pinpoint 可以串流這些行銷活動的事件資料。設定事件串流後，Amazon Pinpoint 會從您在設定期間指定的目的地擷取您從行銷活動傳送的電子郵件或簡訊的事件資料，供您檢視。如需 Amazon Pinpoint 串流用於電子郵件和簡訊資料的詳細資訊，請參閱 [從 Amazon Pinpoint 傳送電子郵件事件資料串流](event-streams-data-email.md)和 [來自 Amazon Pinpoint 的簡訊事件資料串流](event-streams-data-sms.md)。如需如何設定事件串流的資訊，請參閱 [設定 Amazon Pinpoint 透過 Amazon Kinesis 或 Amazon Data Firehose 串流應用程式事件資料](event-streams-setup.md)。

## 行銷活動事件範例
<a name="event-streams-data-campaign-example"></a>

行銷活動事件的 JSON 物件包含下列範例所示的資料。

```
{
  "event_type": "_campaign.send",
  "event_timestamp": 1562109497426,
  "arrival_timestamp": 1562109497494,
  "event_version": "3.1",
  "application": {
    "app_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
    "sdk": {}
  },
  "client": {
    "client_id": "d8dcf7c5-e81a-48ae-8313-f540cexample"
  },
  "device": {
    "platform": {}
  },
  "session": {},
  "attributes": {
    "treatment_id": "0",
    "campaign_activity_id": "5473285727f04865bc673e527example",
    "delivery_type": "GCM",
    "campaign_id": "4f8d6097c2e8400fa3081d875example",
    "campaign_send_status": "SUCCESS"
  },
  "client_context": {
    "custom": {
      "endpoint": "{\"ChannelType\":\"GCM\",\"EndpointStatus\":\"ACTIVE\",
          ↳\"OptOut\":\"NONE\",\"RequestId\":\"ec229696-9d1e-11e9-8bf1-85d0aexample\",
          ↳\"EffectiveDate\":\"2019-07-02T23:12:54.836Z\",\"User\":{}}"
    }
  },
  "awsAccountId": "123456789012"
}
```

## 行銷活動事件屬性
<a name="event-streams-data-campaign-attributes"></a>

本區段定義包含在行銷活動事件串流中的屬性。


| 屬性 | Description | 
| --- | --- | 
| event\_type | 事件的類型。可能值為：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/pinpoint/latest/developerguide/event-streams-data-campaign.html) | 
| event\_timestamp | 報告事件的時間，以 Unix 時間顯示 (毫秒)。 | 
| arrival\_timestamp | Amazon Pinpoint 收到事件的時間，顯示為 Unix 時間 (以毫秒為單位)。 | 
| event\_version | 事件 JSON 結構描述的版本。 在您的事件處理應用程式中檢查此版本，讓您知道何時更新應用程式以回應結構描述更新。  | 
| application | 與事件相關聯的 Amazon Pinpoint 專案的資訊。如需詳細資訊，請參閱[應用程式](#event-streams-data-campaign-attributes-application)表。 | 
| client | 事件相關聯的端點資訊。如需詳細資訊，請參閱[用戶端](#event-streams-data-campaign-attributes-client)表。 | 
| device | 回報事件的裝置資訊。若為行銷活動和交易訊息，此物件為空。 | 
| session | 產生事件的工作階段資訊。若為行銷活動，此物件為空。 | 
| attributes | 與事件相關聯的屬性。若為您應用程式之一所報告的事件，此物件可包含由應用程式定義的自訂屬性。若為您傳送行銷活動時所建立的事件，此物件可包含與行銷活動相關聯的屬性。若為您傳送交易訊息時所產生的事件，此物件可包含訊息本身的相關資訊。<br />如需詳細資訊，請參閱[屬性](#event-streams-data-campaign-attributes-attrs)表。 | 
| client\_context | 包含一個 custom 物件，其中包含一個 endpoint 屬性。endpoint 屬性包含行銷活動傳送目標端點的端點紀錄內容。 | 
| awsAccountId | 用來傳送訊息 AWS 的帳戶 ID。 | 

### 應用程式
<a name="event-streams-data-campaign-attributes-application"></a>

包含與事件相關聯的 Amazon Pinpoint 專案資訊。


| 屬性 | Description | 
| --- | --- | 
| app\_id | 回報事件的 Amazon Pinpoint 專案的唯一 ID。 | 
| sdk | 過去用來報告事件的開發套件。 | 

### 屬性
<a name="event-streams-data-campaign-attributes-attrs"></a>

包含產生事件的行銷活動資訊。


| 屬性 | Description | 
| --- | --- | 
| treatment\_id | 如果訊息曾使用 A/B 測試行銷活動傳送，則此值代表訊息的處理方式號碼。若為標準行銷活動，此值為 `0`。 | 
| campaign\_activity\_id | 事件發生時，Amazon Pinpoint 產生的唯一 ID。 | 
| delivery\_type | 行銷活動的交付方法。請勿將此屬性與 `client_context` 的 `endpoint` 屬性下指定的 `ChannelType` 欄位搞混。`ChannelType` 欄位通常基於訊息傳送的目的地端點而定。<br />對於只支援一種端點類型的管道，`delivery_type` 和 `ChannelType` 欄位的值相同。以電子郵件管道為例，`delivery_type` 和 `ChannelType` 欄位的值與 EMAIL 相同。<br />但對於支援不同端點類型的管道 (例如自訂頻道) 而言，情況並不總是如此。您可以針對不同的端點使用自訂管道，例如 EMAIL、SMS、CUSTOM 等。就本案例而言，`delivery_type` 識別自訂交付事件 CUSTOM，且 `ChannelType` 指定傳送行銷活動的目的地端點類型，例如 EMAIL、SMS、CUSTOM 等。如需建立自訂頻道的詳細資訊，請參閱 [使用 Webhook 或 Lambda 函數在 Amazon Pinpoint 中建立自訂頻道](channels-custom.md)。<br />可能值為：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/pinpoint/latest/developerguide/event-streams-data-campaign.html) | 
| campaign\_id | 訊息傳送來源的行銷活動唯一 ID。 | 
| campaign\_send\_status | 指出目標端點的行銷活動狀態。可能的值包括：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/pinpoint/latest/developerguide/event-streams-data-campaign.html)  | 

### 用戶端
<a name="event-streams-data-campaign-attributes-client"></a>

包含行銷活動鎖定的目標端點資訊。


| 屬性 | Description | 
| --- | --- | 
| client\_id | 行銷活動傳送端點的 ID。 | 