

**支援終止通知：**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="integrate-events"></a>

在行動或 Web 應用程式中，您可以使用 AWS Mobile SDKs或 [Amazon Pinpoint 事件 API](https://docs.aws.amazon.com/pinpoint/latest/apireference/rest-api-events.html) 向 Amazon Pinpoint 報告用量資料或*事件*。您可以報告事件來擷取資訊，例如，工作階段時間、使用者的購買行為、登入嘗試、或您需要的任何自訂事件類型。

您的應用程式回報事件之後，您可以在 Amazon Pinpoint 主控台檢視分析。**Analytics (分析)** 頁面上的圖表提供許多使用者行為層面的指標。詳情請參閱 *Amazon Pinpoint 使用者指南*中的 [Amazon Pinpoint 分析圖表參考](https://docs.aws.amazon.com/pinpoint/latest/userguide/analytics-charts.html)。

若要在 Amazon Pinpoint 以外的地方分析或儲存資料，可以設定 Amazon Pinpoint 將資料串流到 Amazon Kinesis。如需詳細資訊，請參閱[使用 Amazon Pinpoint 透過 Kinesis 和 Firehose 串流應用程式事件資料](event-streams.md)。

透過使用 AWS Mobile SDKs和 AWS Amplify JavaScript 程式庫，您可以呼叫 Amazon Pinpoint API 來報告下列類型的事件：

**工作階段事件**  
指出使用者開啟和關閉您的應用程式的時間和頻率。  
應用程式報告工作階段事件後，使用 Amazon Pinpoint 主控台的**分析**頁面，檢視**工作階段**、**每日作用中端點**、**7 天保留率**等圖表。

**自訂事件**  
您指派自訂事件類型所定義的非標準事件。您可以將自訂屬性和指標新增到自訂事件。  
在主控台的 **Analytics (分析)** 頁面，**Events (事件)** 標籤會顯示應用程式報告的所有自訂事件的指標。

**獲利事件**  
報告您的應用程式產生的營收，以及使用者購買的項目數。  
在 **Analytics (分析)** 頁面，**Revenue (營收)** 標籤會顯示 **Revenue (營收)**、**Paying users (付費使用者)**、**Units sold (售出品項數量)** 等圖表。

**身分驗證事件**  
指出使用者向您的應用程式進行驗證的頻率。  
在 **Analytics (分析)** 頁面，**Users (使用者)** 標籤會顯示 **Sign-ins (登入次數)**、**Sign-ups (註冊次數)** 和 **Authentication failures (身分驗證失敗)** 的圖表。

## 開始之前
<a name="integrate-events-before"></a>

如果您尚未執行以下操作，請現在執行：
+ 將您的應用程式與 AWS Amplify 整合。請參閱 [使用 AWS Amplify 將您的前端應用程式連線至 Amazon Pinpoint](integrate-sdk.md)。
+ 更新您的應用程式來註冊端點。請參閱 [在應用程式中註冊 Amazon Pinpoint 端點](integrate-endpoints.md)。

## 使用適用於 Android 或 iOS AWS 的行動 SDKs報告事件
<a name="integrate-events-mobile-sdks"></a>

您可以使用適用於 iOS 和 Android AWS 的 Mobile SDKs，讓行動應用程式向 Amazon Pinpoint 報告事件。

如需更新應用程式以記錄事件並將其提交至 Amazon Pinpoint 的詳細資訊，請參閱 AWS Amplify 文件中的下列頁面：
+ iOS 開發套件文件中的[分析](https://docs.amplify.aws/swift/build-a-backend/add-aws-services/analytics/)
+ Android 開發套件文件中的[分析](https://docs.amplify.aws/android/build-a-backend/add-aws-services/analytics/)

## 使用 AWS Amplify JavaScript 程式庫報告事件
<a name="integrate-events-amplify"></a>

您可以使用 AWS Amplify JavaScript 程式庫，讓 JavaScript 和 React Native 應用程式向 Amazon Pinpoint 報告應用程式用量事件。如需更新應用程式以將事件提交到 Amazon Pinpoint 的詳細資訊，請參閱 AWS Amplify JavaScript 文件中的[分析](https://docs.amplify.aws/nextjs/build-a-backend/add-aws-services/analytics/)。

## 使用 Amazon Pinpoint API 報告事件
<a name="integrate-events-api"></a>

您可以使用 Amazon Pinpoint API 或 AWS SDK 大量將事件提交至 Amazon Pinpoint。詳情請參閱 *Amazon Pinpoint API 參考*中的[事件](https://docs.aws.amazon.com/pinpoint/latest/apireference/rest-api-events.html)。

## 後續步驟
<a name="integrate-events-next"></a>

在您更新應用程式以報告事件後，它會將用量資料傳送至 Amazon Pinpoint。您可以在 主控台中檢視此資料，並將其串流至 Amazon Kinesis。您也可以更新您的應用程式，以處理您使用 Amazon Pinpoint 傳送的推送通知。如需詳細資訊，請參閱[AWS 《 最終使用者傳訊推送使用者指南](https://docs.aws.amazon.com//push-notifications/latest/userguide/what-is-service.html)》中的下列主題。
+ [設定推送通知](https://docs.aws.amazon.com//push-notifications/latest/userguide/procedure-enable-push.html)
+ [設定 Swift 推播通知](https://docs.aws.amazon.com//push-notifications/latest/userguide/mobile-push.html#apns-setup)
+ [設定 Android 推播通知](https://docs.aws.amazon.com//push-notifications/latest/userguide/mobile-push.html#mobile-push-android)
+ [設定流暢推播通知](https://docs.aws.amazon.com//push-notifications/latest/userguide/mobile-push.html#mobile-push-flutter)
+ [設定 React Native 推播通知](https://docs.aws.amazon.com//push-notifications/latest/userguide/mobile-push.html#mobile-push-react-native)
+ [建立專案](https://docs.aws.amazon.com//push-notifications/latest/userguide/mobile-push.html#mobile-push-create-project)
+ [處理推送通知](https://docs.aws.amazon.com//push-notifications/latest/userguide/mobile-push.html#integrate-push-services)