Google アナリティクスの MCP サーバーを試します。
GitHub からインストールし、詳細については
お知らせをご覧ください。
WebhookNotification
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
リソースが更新されたときに Google Analytics Data API から webhook サーバーに webhook 通知を送信するように、長時間実行オペレーション リソースを構成します。
通知構成には非公開の値が含まれ、GCP プロジェクトにのみ表示されます。異なる GCP プロジェクトが、同じ長時間実行オペレーション リソースに異なる Webhook 通知を接続する場合があります。
JSON 表現 |
{
"uri": string,
"channelToken": string
} |
フィールド |
uri |
string
省略可。Webhook 通知を受信するウェブアドレス。このアドレスには、長時間実行オペレーション リソースの状態が変化するたびに POST リクエストが送信されます。POST リクエストの本文には、長時間実行オペレーション リソースの JSON バージョンと sentTimestamp フィールドの両方が含まれます。送信されたタイムスタンプには、リクエストが送信されたエポックからの UNIX マイクロ秒が指定されます。これにより、リプレイされた通知を識別できます。 URI の例は https://us-central1-example-project-id.cloudfunctions.net/example-function-1 です。 URI は HTTPS を使用し、ウェブサーバーに有効な SSL 証明書があるサイトを参照している必要があります。URI の文字列の最大長は 128 文字で、RFC 1738 の許可リストに登録されている文字のみを使用する必要があります。 Webhook サーバーは、通知を受信すると、5 秒以内に HTTP レスポンス ステータス コード 200 で応答することが求められます。 Webhook 通知を使用するには URI が必要です。 この Webhook サーバーへのリクエストには、サービス アカウント google-analytics-audience-export@system.gserviceaccount.com を認証する ID トークンが含まれます。ID トークンの詳細については、https://cloud.google.com/docs/authentication/token-types#id をご覧ください。Google Cloud Functions では、認証を必要とする関数を構成できます。Cloud IAM で、Webhook の POST リクエストが Google Cloud Functions の認証に合格するように、サービス アカウントに Cloud Run 起動元(roles/run.invoker )ロールと Cloud Functions 起動元(roles/cloudfunctions.invoker )ロールの権限を付与する必要があります。この API は任意の URI に Webhook 通知を送信できます。Google Cloud Functions 以外の Webhook サーバーの場合、認可ベアラ ヘッダーのこの ID トークンは、必要ない場合は無視する必要があります。
|
channelToken |
string
省略可。チャンネル トークンは任意の文字列値で、文字列の最大長は 64 文字にする必要があります。チャンネル トークンを使用すると、Webhook 通知の送信元を確認できます。これにより、メッセージのなりすましを防ぐことができます。チャネル トークンは、Webhook POST リクエストの X-Goog-Channel-Token HTTP ヘッダーで指定します。 webhook 通知を使用するのにチャンネル トークンは必要ありません。
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\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,["# WebhookNotification\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\nConfigures a long-running operation resource to send a webhook notification from the Google Analytics Data API to your webhook server when the resource updates.\n\nNotification configurations contain private values \\& are only visible to your GCP project. Different GCP projects may attach different webhook notifications to the same long-running operation resource.\n\n| JSON representation |\n|---------------------------------------------------|\n| ``` { \"uri\": string, \"channelToken\": string } ``` |\n\n| Fields ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `uri` | `string` Optional. The web address that will receive the webhook notification. This address will receive POST requests as the state of the long running operation resource changes. The POST request will contain both a JSON version of the long running operation resource in the body and a `sentTimestamp` field. The sent timestamp will specify the unix microseconds since the epoch that the request was sent; this lets you identify replayed notifications. An example URI is `https://us-central1-example-project-id.cloudfunctions.net/example-function-1`. The URI must use HTTPS and point to a site with a valid SSL certificate on the web server. The URI must have a maximum string length of 128 characters \\& use only the allowlisted characters from [RFC 1738](https://www.rfc-editor.org/rfc/rfc1738). When your webhook server receives a notification, it is expected to reply with an HTTP response status code of 200 within 5 seconds. A URI is required to use webhook notifications. Requests to this webhook server will contain an ID token authenticating the service account `google-analytics-audience-export@system.gserviceaccount.com`. To learn more about ID tokens, see \u003chttps://cloud.google.com/docs/authentication/token-types#id\u003e. For Google Cloud Functions, this lets you configure your function to require authentication. In Cloud IAM, you will need to grant the service account permissions to the Cloud Run Invoker (`roles/run.invoker`) \\& Cloud Functions Invoker (`roles/cloudfunctions.invoker`) roles for the webhook post request to pass Google Cloud Functions authentication. This API can send webhook notifications to arbitrary URIs; for webhook servers other than Google Cloud Functions, this ID token in the authorization bearer header should be ignored if it is not needed. |\n| `channel``Token` | `string` Optional. The channel token is an arbitrary string value and must have a maximum string length of 64 characters. Channel tokens allow you to verify the source of a webhook notification. This guards against the message being spoofed. The channel token will be specified in the `X-Goog-Channel-Token` HTTP header of the webhook POST request. A channel token is not required to use webhook notifications. |"]]