Reference documentation and code samples for the Google Analytics Data V1alpha Client class WebhookNotification.
Configures a long-running operation resource to send a webhook notification
from the Google Analytics Data API to your webhook server when the resource
updates.
Notification 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.
Generated from protobuf message google.analytics.data.v1alpha.WebhookNotification
Namespace
Google \ Analytics \ Data \ V1alpha
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ 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. 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 https://cloud.google.com/docs/authentication/token-types#id. 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.
↳ 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.
getUri
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.
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
https://cloud.google.com/docs/authentication/token-types#id. 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.
Returns
Type
Description
string
hasUri
clearUri
setUri
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.
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
https://cloud.google.com/docs/authentication/token-types#id. 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.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getChannelToken
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.
Returns
Type
Description
string
hasChannelToken
clearChannelToken
setChannelToken
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Analytics Data V1alpha Client - Class WebhookNotification (0.22.3)\n\nVersion latestkeyboard_arrow_down\n\n- [0.22.3 (latest)](/php/docs/reference/analytics-data/latest/V1alpha.WebhookNotification)\n- [0.22.2](/php/docs/reference/analytics-data/0.22.2/V1alpha.WebhookNotification)\n- [0.21.1](/php/docs/reference/analytics-data/0.21.1/V1alpha.WebhookNotification)\n- [0.20.1](/php/docs/reference/analytics-data/0.20.1/V1alpha.WebhookNotification)\n- [0.19.0](/php/docs/reference/analytics-data/0.19.0/V1alpha.WebhookNotification)\n- [0.18.0](/php/docs/reference/analytics-data/0.18.0/V1alpha.WebhookNotification)\n- [0.17.1](/php/docs/reference/analytics-data/0.17.1/V1alpha.WebhookNotification)\n- [0.16.4](/php/docs/reference/analytics-data/0.16.4/V1alpha.WebhookNotification)\n- [0.14.0](/php/docs/reference/analytics-data/0.14.0/V1alpha.WebhookNotification)\n- [0.13.0](/php/docs/reference/analytics-data/0.13.0/V1alpha.WebhookNotification)\n- [0.12.0](/php/docs/reference/analytics-data/0.12.0/V1alpha.WebhookNotification)\n- [0.11.2](/php/docs/reference/analytics-data/0.11.2/V1alpha.WebhookNotification)\n- [0.10.1](/php/docs/reference/analytics-data/0.10.1/V1alpha.WebhookNotification)\n- [0.9.5](/php/docs/reference/analytics-data/0.9.5/V1alpha.WebhookNotification) \n| **Beta**\n|\n|\n| This library is covered by the [Pre-GA Offerings Terms](/terms/service-terms#1)\n| of the Terms of Service. Pre-GA libraries might have limited support,\n| and changes to pre-GA libraries might not be compatible with other pre-GA versions.\n| For more information, see the\n[launch stage descriptions](/products#product-launch-stages). \nReference documentation and code samples for the Google Analytics Data V1alpha Client class WebhookNotification.\n\nConfigures a long-running operation resource to send a webhook notification\nfrom the Google Analytics Data API to your webhook server when the resource\nupdates.\n\nNotification configurations contain private values \\& are only visible to your\nGCP project. Different GCP projects may attach different webhook\nnotifications to the same long-running operation resource.\n\nGenerated from protobuf message `google.analytics.data.v1alpha.WebhookNotification`\n\nNamespace\n---------\n\nGoogle \\\\ Analytics \\\\ Data \\\\ V1alpha\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getUri\n\nOptional. The web address that will receive the webhook notification. This\naddress will receive POST requests as the state of the long running\noperation resource changes. The POST request will contain both a JSON\nversion of the long running operation resource in the body and a\n`sentTimestamp` field. The sent timestamp will specify the unix\nmicroseconds since the epoch that the request was sent; this lets you\nidentify replayed notifications.\n\nAn example URI is\n`https://us-central1-example-project-id.cloudfunctions.net/example-function-1`.\nThe URI must use HTTPS and point to a site with a valid SSL certificate on\nthe web server. The URI must have a maximum string length of 128 characters\n\\& use only the allowlisted characters from [RFC\n1738](https://www.rfc-editor.org/rfc/rfc1738).\nWhen your webhook server receives a notification, it is expected to reply\nwith an HTTP response status code of 200 within 5 seconds.\nA URI is required to use webhook notifications.\nRequests to this webhook server will contain an ID token authenticating the\nservice account\n`google-analytics-audience-export@system.gserviceaccount.com`. To learn\nmore about ID tokens, see\n\u003chttps://cloud.google.com/docs/authentication/token-types#id\u003e. For Google\nCloud Functions, this lets you configure your function to require\nauthentication. In Cloud IAM, you will need to grant the service account\npermissions to the Cloud Run Invoker (`roles/run.invoker`) \\& Cloud\nFunctions Invoker (`roles/cloudfunctions.invoker`) roles for the webhook\npost request to pass Google Cloud Functions authentication. This API can\nsend webhook notifications to arbitrary URIs; for webhook servers other\nthan Google Cloud Functions, this ID token in the authorization bearer\nheader should be ignored if it is not needed.\n\n### hasUri\n\n### clearUri\n\n### setUri\n\nOptional. The web address that will receive the webhook notification. This\naddress will receive POST requests as the state of the long running\noperation resource changes. The POST request will contain both a JSON\nversion of the long running operation resource in the body and a\n`sentTimestamp` field. The sent timestamp will specify the unix\nmicroseconds since the epoch that the request was sent; this lets you\nidentify replayed notifications.\n\nAn example URI is\n`https://us-central1-example-project-id.cloudfunctions.net/example-function-1`.\nThe URI must use HTTPS and point to a site with a valid SSL certificate on\nthe web server. The URI must have a maximum string length of 128 characters\n\\& use only the allowlisted characters from [RFC\n1738](https://www.rfc-editor.org/rfc/rfc1738).\nWhen your webhook server receives a notification, it is expected to reply\nwith an HTTP response status code of 200 within 5 seconds.\nA URI is required to use webhook notifications.\nRequests to this webhook server will contain an ID token authenticating the\nservice account\n`google-analytics-audience-export@system.gserviceaccount.com`. To learn\nmore about ID tokens, see\n\u003chttps://cloud.google.com/docs/authentication/token-types#id\u003e. For Google\nCloud Functions, this lets you configure your function to require\nauthentication. In Cloud IAM, you will need to grant the service account\npermissions to the Cloud Run Invoker (`roles/run.invoker`) \\& Cloud\nFunctions Invoker (`roles/cloudfunctions.invoker`) roles for the webhook\npost request to pass Google Cloud Functions authentication. This API can\nsend webhook notifications to arbitrary URIs; for webhook servers other\nthan Google Cloud Functions, this ID token in the authorization bearer\nheader should be ignored if it is not needed.\n\n### getChannelToken\n\nOptional. The channel token is an arbitrary string value and must have a\nmaximum string length of 64 characters. Channel tokens allow you to verify\nthe source of a webhook notification. This guards against the message being\nspoofed. The channel token will be specified in the `X-Goog-Channel-Token`\nHTTP header of the webhook POST request.\n\nA channel token is not required to use webhook notifications.\n\n### hasChannelToken\n\n### clearChannelToken\n\n### setChannelToken\n\nOptional. The channel token is an arbitrary string value and must have a\nmaximum string length of 64 characters. Channel tokens allow you to verify\nthe source of a webhook notification. This guards against the message being\nspoofed. The channel token will be specified in the `X-Goog-Channel-Token`\nHTTP header of the webhook POST request.\n\nA channel token is not required to use webhook notifications."]]