這類要求會包含 ID 權杖,用於驗證服務帳戶 google-analytics-audience-export@system.gserviceaccount.com。如要進一步瞭解 ID 權杖,請參閱 https://cloud.google.com/docs/authentication/token-types#id。對於 Google Cloud Functions,這可讓您將函式設為需要驗證。您必須在 Cloud IAM 中將服務帳戶權限授予 Cloud Run 叫用者 (roles/run.invoker) 和 Cloud Functions 叫用者 (roles/cloudfunctions.invoker) 角色,才能讓 webhook 發布要求通過 Google Cloud Functions 驗證。這個 API 可將 webhook 通知傳送至任意 URI;如果是 Google Cloud Functions 以外的 webhook 伺服器,則應忽略授權代管者標頭中的 ID 權杖 (如果不需要的話)。
[[["容易理解","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"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eWebhook notifications can be configured for long-running operations in the Google Analytics Data API to send updates to your server.\u003c/p\u003e\n"],["\u003cp\u003eThese notifications are project-specific and include a JSON payload with operation details and a timestamp.\u003c/p\u003e\n"],["\u003cp\u003eThe webhook configuration requires a URI using HTTPS with a valid SSL certificate, and optionally, a channel token for verification.\u003c/p\u003e\n"],["\u003cp\u003eWhen receiving a notification, your server should respond with an HTTP 200 status code within 5 seconds.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication for Google Cloud Functions is provided through an ID token representing the service account \u003ccode\u003egoogle-analytics-audience-export@system.gserviceaccount.com\u003c/code\u003e, while other webhook servers can ignore this token.\u003c/p\u003e\n"]]],["This document outlines the configuration for webhook notifications from the Google Analytics Data API. You can set up a webhook server (`uri`) to receive POST requests containing long-running operation resource updates in JSON format, along with a `sentTimestamp`. The `uri` must be HTTPS with a valid SSL certificate and is required for webhook notifications. Optionally, use a `channelToken` for source verification, which is included in the `X-Goog-Channel-Token` header. Notifications will include an ID token for authentication.\n"],null,[]]