This is the documentation for Recommendations AI, Retail Search, and the new Retail console. To use Retail Search in the restricted GA phase, contact Cloud sales.

If you are only using Recommendations AI, remain on the Recommendations console and refer to the Recommendations AI documentation.

Method: projects.locations.catalogs.userEvents.collect

Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain.

This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.

HTTP request

GET https://retail.googleapis.com/v2alpha/{parent=projects/*/locations/*/catalogs/*}/userEvents:collect

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The parent catalog name, such as projects/1234/locations/global/catalogs/default_catalog.

Query parameters

Parameters
userEvent

string

Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.

uri

string

The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for 3rd party requests.

ets

string (int64 format)

The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.

Request body

The request body must be empty.

Response body

If successful, the response is a generic HTTP response whose format is defined by the method.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.