MCP-Server für Google Analytics ausprobieren Installieren Sie das Tool über
GitHub. Weitere Informationen finden Sie in der
Ankündigung.
WebhookNotification
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Hiermit wird eine langlaufende Vorgangsressource konfiguriert, um bei einer Aktualisierung der Ressource eine Webhook-Benachrichtigung von der Google Analytics Data API an Ihren Webhook-Server zu senden.
Benachrichtigungskonfigurationen enthalten private Werte und sind nur für Ihr GCP-Projekt sichtbar. Unterschiedliche GCP-Projekte können derselben Ressource für langlaufende Vorgänge unterschiedliche Webhook-Benachrichtigungen zuordnen.
JSON-Darstellung |
{
"uri": string,
"channelToken": string
} |
Felder |
uri |
string
Optional. Die Webadresse, an die die Webhook-Benachrichtigung gesendet werden soll. Diese Adresse erhält POST-Anfragen, wenn sich der Status der Ressource für den lang laufenden Vorgang ändert. Die POST-Anfrage enthält sowohl eine JSON-Version der Ressource für den lang laufenden Vorgang im Text als auch ein sentTimestamp -Feld. Der gesendete Zeitstempel gibt die Unix-Mikrosekunden seit der Epoche an, zu der die Anfrage gesendet wurde. So können Sie wiederholte Benachrichtigungen erkennen. Ein Beispiel für einen URI ist https://us-central1-example-project-id.cloudfunctions.net/example-function-1 . Der URI muss HTTPS verwenden und auf eine Website mit einem gültigen SSL-Zertifikat auf dem Webserver verweisen. Der URI darf maximal 128 Zeichen lang sein und nur die Zeichen aus der Zulassungsliste von RFC 1738 enthalten. Wenn Ihr Webhook-Server eine Benachrichtigung empfängt, sollte er innerhalb von 5 Sekunden mit dem HTTP-Antwortstatuscode 200 antworten. Für die Verwendung von Webhook-Benachrichtigungen ist ein URI erforderlich. Anfragen an diesen Webhook-Server enthalten ein ID-Token, mit dem das Dienstkonto google-analytics-audience-export@system.gserviceaccount.com authentifiziert wird. Weitere Informationen zu ID-Tokens finden Sie unter https://cloud.google.com/docs/authentication/token-types#id. Bei Google Cloud Functions können Sie Ihre Funktion so konfigurieren, dass eine Authentifizierung erforderlich ist. In Cloud IAM müssen Sie dem Dienstkonto die Berechtigungen für die Rollen „Cloud Run-Aufrufer“ (roles/run.invoker ) und „Cloud Functions-Aufrufer“ (roles/cloudfunctions.invoker ) erteilen, damit die Webhook-Postanfrage die Google Cloud Functions-Authentifizierung besteht. Diese API kann Webhook-Benachrichtigungen an beliebige URIs senden. Bei anderen Webhook-Servern als Google Cloud Functions sollte dieses ID-Token im Autorisierungs-Bearer-Header ignoriert werden, wenn es nicht benötigt wird.
|
channelToken |
string
Optional. Das Kanaltoken ist ein beliebiger Stringwert und darf maximal 64 Zeichen lang sein. Mit Kanaltokens kannst du die Quelle einer Webhook-Benachrichtigung überprüfen. So wird verhindert, dass die Nachricht gefälscht wird. Das Kanaltoken wird im X-Goog-Channel-Token -HTTP-Header der Webhook-POST-Anfrage angegeben. Für die Verwendung von Webhook-Benachrichtigungen ist kein Kanaltoken erforderlich.
|
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 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. |"]]