Google 애널리틱스용 MCP 서버를 사용해 보세요.
GitHub에서 설치하고
공지사항에서 자세한 내용을 확인하세요.
WebhookNotification
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
리소스가 업데이트될 때 Google 애널리틱스 Data API에서 웹훅 서버로 웹훅 알림을 전송하도록 장기 실행 작업 리소스를 구성합니다.
알림 구성에는 비공개 값이 포함되며 GCP 프로젝트에만 표시됩니다. 서로 다른 GCP 프로젝트가 동일한 장기 실행 작업 리소스에 서로 다른 Webhook 알림을 연결할 수 있습니다.
JSON 표현 |
{
"uri": string,
"channelToken": string
} |
필드 |
uri |
string
선택사항입니다. 웹훅 알림을 수신할 웹 주소입니다. 장기 실행 작업 리소스의 상태가 변경될 때 이 주소로 POST 요청이 수신됩니다. POST 요청의 본문에는 장기 실행 작업 리소스의 JSON 버전과 sentTimestamp 필드가 모두 포함됩니다. 전송된 타임스탬프는 요청이 전송된 에포크 이후의 Unix 마이크로초를 지정합니다. 이를 통해 재생된 알림을 식별할 수 있습니다. URI의 예는 https://us-central1-example-project-id.cloudfunctions.net/example-function-1 입니다. URI는 HTTPS를 사용해야 하며 웹 서버에 유효한 SSL 인증서가 있는 사이트를 가리켜야 합니다. URI의 최대 문자열 길이는 128자(영문 기준)여야 하며 RFC 1738의 허용 목록에 있는 문자만 사용해야 합니다. 웹훅 서버가 알림을 수신하면 5초 이내에 HTTP 응답 상태 코드 200으로 응답해야 합니다. 웹훅 알림을 사용하려면 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 게시 요청이 Google Cloud Functions 인증을 통과하려면 Cloud Run 호출자 (roles/run.invoker ) 및 Cloud Functions 호출자 (roles/cloudfunctions.invoker ) 역할에 서비스 계정 권한을 부여해야 합니다. 이 API는 임의의 URI로 웹훅 알림을 보낼 수 있습니다. Google Cloud Functions 이외의 웹훅 서버의 경우 승인 베어러 헤더의 이 ID 토큰은 필요하지 않으면 무시해야 합니다.
|
channelToken |
string
선택사항입니다. 채널 토큰은 임의의 문자열 값이며 최대 문자열 길이는 64자(영문 기준)여야 합니다. 채널 토큰을 사용하면 웹훅 알림의 소스를 확인할 수 있습니다. 이렇게 하면 메일이 스푸핑되는 것을 방지할 수 있습니다. 채널 토큰은 webhook POST 요청의 X-Goog-Channel-Token HTTP 헤더에 지정됩니다. 웹훅 알림을 사용하기 위해 채널 토큰이 필요하지는 않습니다.
|
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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. |"]]